🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #808

uninitialized static members

#808
From: Thomas M. Breuel
Date: Sun, 16 Aug 1992 21:04
27 lines
1137 bytes
I'm having a problem with uninitialized static class members in GCC
C++ 2.2.2.

Basically, if I only define the static class member inside the class
(without explicitly initializing it), I get a link-time undefined
symbol error.

I was under the impression that I didn't have to provide any
definition (in addition to what is present in the header) for
uninitialized static class members.

				Thomas.

PS: A little more concretely:

struct NISTDigitImages {
	static int *table;
	...
};

 ...

gcc -L/homes/tmb/src/nvis/lib  rec-gh.o loadihdr.o ihead.o g4decomp.o winlib.o -lX11 -lvis -lm   -o rec-gh
ld: Undefined symbol 
   __15NISTDigitImages$table 
collect: /usr/bin/ld returned 2 exit status
make: *** [rec-gh] Error 1
Technical Details
Message-ID: <9208161704.AA07645@idiap.ch>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!idiap.CH!tmb

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!idiap.CH!tmb
From: tmb@idiap.CH (Thomas M. Breuel)
Subject: uninitialized static members
Message-ID: <9208161704.AA07645@idiap.ch>
Sender: gnulists@ai.mit.edu
Reply-To: tmb@idiap.ch
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 16 Aug 1992 21:04:40 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 28