[Dev-C++] Multiply-included header problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: FerretallicA <fer...@ho...> - 2003-07-27 06:01:03
|
Oo oi, I have a bit of a dilemma, albiet a seemingly simplistic one... Say I have 3 files as follows- MAIN.CPP #include "main.h" EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H int some_variable_important_to_lots_of_functions; I keep getting errors that some_variable_important_to_lots_of_functions is being redefined. I have tried the "#pragma once" solution which worked with Visual C++ but it doesn't seem to work in Dev-C++. I tried the following- MAIN.CPP #include "main.h" int some_variable_important_to_lots_of_functions; EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H extern int some_variable_important_to_lots_of_functions; Still the same problem. Does anyone know of a solution to this? Is this some mistake I am making, a problem with Dev-C++'s compiler, or what? -FerretallicA |