Help? Hopefully not a silly question. Regarding global declarations
Perhaps this just isn't possible but I was making a program which needs a global access to a database resource. Every file includes my "global.h" file, however when I try to declare it as an extern it fails.
Note: dbaccess is the name of the class as well.
snippet of globals.h
#include "dbaccess.h"
...
extern dbaccess theDB;
then it gives me 2 errors:
error C2146: syntax error : missing ';' before identifier 'theDB'
error C2501: 'theDB' : missing storage-class or type specifiers
the second one should follow the first since it has no idea what theDB is apparently.
globals.h is included by dbaccess.h, and I have guards against circular inclusion.
I could do this in other ways I know, but it would be easier to have it global for my purposes, perhaps a bit faster as well. Any ideas / help?