www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/05/12/11:06:36

Date: Tue, 12 May 92 10:29:38 EDT
From: DJ Delorie <dj AT ctron DOT com>
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 <rms AT cs DOT tu-berlin DOT de>
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 <stream.h>

>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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019