🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #238

ld: Undefined symbol __$_9xxx

#238
From: Jonas Svanberg
Date: Sat, 12 Sep 1992 15:39
31 lines
1731 bytes
I believe I have the same problem as Mr D. Vladicic in his 
contribution "C++ constructor problem"

I have a case when a static initialization of the form:

#include "Package.hh"
static Package* pac1 = new Package("pac 1");

will work but this:

static Package pac2("pac 2");

won`t work 'cause the linker complaines about __$_9Package
as an undefined symbol. I don't quite get it why the former
works and the latter won't. Both initializations are
swallowed by the compiler.
The class Package is separately compiled, but that shouldn't
affect the result, should it?
I use g++ 2.2 and am running on a Sun Sparc1.

I can do with the pointer initialization but it's irritating
nevertheless...

O----------------------------O----------------------------------O
| Jonas Svanberg             | Email: svan@isy.liu.se           |
| Div. of Information Theory O----------------------------------O
| Department of E.E. (ISY)   | "And Noah said to the animals:   | 
| Linkoping University       |  - Go out and multiply!          |  
| S-581 83 Linkoping         |  The snake said:                 |
| SWEDEN                     |  - But how can I? I'm an adder!" |
O----------------------------O----------------------------------O
Technical Details
Message-ID: <1992Sep12.153955.28659@isy.liu.se>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!liuida!isy!isy.liu.se!svan
References: <1992Sep9.011632.29931@monu6.cc.monash.edu.au>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.help
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!liuida!isy!isy.liu.se!svan
From: svan@isy.liu.se (Jonas Svanberg)
Subject: ld: Undefined symbol __$_9xxx
Message-ID: <1992Sep12.153955.28659@isy.liu.se>
Keywords: ld link linker linking constructor
Sender: news@isy.liu.se (Lord of the News)
Reply-To: svan@isy.liu.se
Organization: Linkoping University
References: <1992Sep9.011632.29931@monu6.cc.monash.edu.au>
Date: Sat, 12 Sep 1992 15:39:55 GMT
Lines: 32