[Dev-C++] multiple definition linker error
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Andrew J. <bu...@wo...> - 2002-07-25 18:06:09
|
hi, I call a header file (tree.h) from two c files(main.c & tree.c)... when I do this, an int fileNo gets declared twice, because the header is called twice, twice causing a linker error. I then add: #ifndef TREE_H #define TREE_H //functions and struct here int fileNo = 0; #endif for some reason that didnt keep the compiler from reading the contents of tree.h multiple times... im rather stumped, it almost seems like its ignoring all the preprocessor commands except #include altogether. i cant imagine any linker params that id need to set but im not sure. im running version 4.9.4.2 of dev and in compiler options, I have all 3 c compiler options selected. anyone have any ideas? Thanks. |