-- color.h --- class color { [...] static const color WHITE; } ------ #include "color.h" -- color.cpp --- const color color::WHITE(255,255,255); [...] ------ color.o is generated by "g++ -o color.o -c color.cpp" -- light.h --- #include "color.h" class light { [...] static const light SUN; } ------ -- light.cpp --- #include "light.h" const light light::SUN(..., color::WHITE); // the color of SUN is WHITE [...] ------ light.o is generated by "g++ -o light.o -c light.cpp"
The application is generated by "g++ color.o light.o main.o -o application", but inside the application, the color of the SUN is not WHITE.
Is guess this is because code is generated such that the SUN is initialized before WHITE is initialized...
Suggestions? Advice?
-- Bruno de Oliveira Schneider bruno_schneider@xxxxxxxxxxx
_________________________________________________________________
MSN Messenger: instale grátis e converse com seus amigos. http://messenger.msn.com.br