[Dev-C++] Accessing static data from non-static function
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Klaas M. <kla...@gm...> - 2006-01-17 16:09:33
|
Hey, I am trying to make a class with some static pointers to allegro bitmaps. But now i cannot access the static data on the normal way. I declared the data so: static BITMAP* bmp; and tried to access it from other= , non-static member functions from the same class by using simply bmp, but that don't work. Using Classname::bmp also don't work, not in the other non-static member functions from the same class, and not from other functions, such as main(). I have included the header file. I always get th= e same error's: [Linker error] undefined reference to `Classname::bmp' for every time I tried to access the static date. I have also tried to make a static int but that also don't work. Could anyone tell me what i'm doing wrong? |