Ok, this is probably standard stuff, but seems my programming classes were superficial and i'm left to discover stuff like this on my own.
I have three files like the following ones. Upon compiling, i get "multiple definition error" for 'verbose' and anything i try to define with it (global)
Framework.cpp
-------------
#include "Framework.h"
Framework.h
-----------
#ifndef _FRAMEWORK_H
#define _FRAMEWORK_H
bool verbose;
#endif
main.cpp
--------
#include "Framework.h"
int main(int argc, char **argv)
{
verbose = false;
return 0;
}
The question is... why? shouldn't the #ifndef prevent duplicate inclusion of Framework.h ?
HALP!
edit: made code less annoying, smaller post now
[Edited by - Madster on February 12, 2005 12:33:41 AM]