Multiple declaration errors...:( Still wont go away
I knwo i''ve posted about this before, buit i still have problems. I have one header file that holds all global variables, and i inlcude it in all my .cpp files. Now, i set the
#idndef
#define
#endif
directives BUT i STILL gets errors! I managed to bypass them with /FORCE:MULTIPLE in my settings, but now they just come out as warnings. Why do i keep getting these warnings? I set the damn # directives in the header and all the code is inside the directives, so why would i still get a crap load of errors...er warnings?
Everyone keeps saying, put the directives in, i have them in and it still dont work! What now?
September 16, 2001 02:59 AM
(globals.h)
extern int a;
extern float b;
(globals.cpp)
#include''globals.h''
int a; // global scope
float b;
(fileX.cpp)
#include''globals.h''
..
..
(fileY.cpp)
#include''globals.h''
..
..
extern int a;
extern float b;
(globals.cpp)
#include''globals.h''
int a; // global scope
float b;
(fileX.cpp)
#include''globals.h''
..
..
(fileY.cpp)
#include''globals.h''
..
..
(globals.h)
extern int a;
extern float b;
(globals.cpp)
#include''globals.h''
int a; // global scope
float b;
(fileX.cpp)
#include''globals.h''
..
void func()
{
a=4;
}
(fileY.cpp)
#include''globals.h''
int func()
{
return a;
}
http://members.xoom.com/myBollux
extern int a;
extern float b;
(globals.cpp)
#include''globals.h''
int a; // global scope
float b;
(fileX.cpp)
#include''globals.h''
..
void func()
{
a=4;
}
(fileY.cpp)
#include''globals.h''
int func()
{
return a;
}
http://members.xoom.com/myBollux
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement