🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: g++ bug: static data members

#805
From: Mike Stump
Date: Sat, 29 Aug 1992 12:13
34 lines
1277 bytes
This is not a known bug in g++, in fact it is a known ``not a bug'' in g++.

Try putting a definition for C::I someplace in the top level, like:

int C::I;

after all your code.  Please read a good C++ book for more details.

> Date: Tue, 4 Aug 1992 20:05:50 -0600
> From: "Alexander L. Wolf" <alw@anchor.cs.colorado.edu>
> Message-Id: <199208050205.AA10485@anchor.cs.colorado.edu>
> To: bug-gcc@prep.ai.mit.edu
> Cc: alw@cs.colorado.edu

> Compiling the following very simple C++ program 

>         struct C {
>                 static int I;
>         };

>         int main ()
>         {
>                 C::I = 0;
>         };

> produces the following error output

>         ld: Undefined symbol
>            __1C$I
>         collect: /usr/bin/ld returned 2 exit status

> The version of g++ used is 2.2.2.

> Please let me know whether is this is a known bug in g++.
Technical Details
Message-ID: <9208291213.AA28181@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs
From: mrs@cygnus.com (Mike Stump)
Subject: Re:  g++ bug: static data members
Message-ID: <9208291213.AA28181@cygnus.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 29 Aug 1992 12:13:19 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 35