Date: Tue, 12 May 92 10:29:38 EDT From: DJ Delorie To: rms AT cs DOT tu-berlin DOT de Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: static members w/ new gcc >Date: Tue, 12 May 1992 15:28:38 +0200 >From: Susan Thunder Status: O >Wassup! >I recently downloaded the new djgcc, but I`ve encountered various problems >with it. >1st of all, I can`t declare class members static. e.g. check out this little >piece of code: >#include >class xy >{ > public: > static int foo; >}; >main() >{ > xy test; > int a; > xy::foo=2; > cout << xy::foo; >} >which IMHO should work fine (at least it did with the old version). >But the compiler gives me somethin` like this: >TEST.o: Undefined symbol __2xy$foo referenced from text segment The C++ spec states that you have to manually declare static members outside of the class definition, much like you define methods: int xy::foo; The old compiler guessed at where you wanted it to go, or used the #pragma implementation method to decide. >Also, I`ve had a problem with the old Borland make, which worked fine with >the old gcc but now causes HD hangs almost always. I use NDMAKE, which causes tcc to hang, for gcc; and TMAKE, which is too wimpy for gcc, for tcc. >Other than that, I love the whole djgpp project, esp. the new cbgrx lib, which >works wonderfully w/ my old t4k card. It's nice to hear good news for a change :-) DJ dj AT ctron DOT com Life is a banana.