Hello everyone,
I'm trying to accomplish a static structure but fail miserably. If I define them non static everything works as it should, but trying to define it static fails by all google-solutions. Therefore my post here!
My Code:
structure in Genre.h
Code:struct genre{ int id; string name; int score; };Code:class iDNA { private: static genre _go_genre[1750];Error:Code:void iDNA::loadDefaults() { [...] while (res->next()) { _go_genre[li_count].name = res->getString("name"); li_count++; }
OS: Arch Linux x86iDNA.o: In function `iDNA::loadDefaults()':
iDNA.cpp: (.text+0x319): undefined reference to `iDNA::_go_genre'
collect2: ld returned 1 exit status
make: *** [iDNA] Error 1
Compiler: gcc version 4.4.2 (GCC)
Linker: GNU ld (GNU Binutils) 2.20.0.20091101
Hopefully I provided enough information. If not just ask for more!
Thanks in advance,
Arjan Gelderblom



LinkBack URL
About LinkBacks



