[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOLVED - Undefined symbol when loading g++ created library

From: Adam Nielsen
Subject: Re: SOLVED - Undefined symbol when loading g++ created library
Date: Mon, 28 Nov 2005 10:35:39 +1000

Okay, I'm officially a fool now.  The problem was I'd defined a
constructor RootClass::RootClass(void) as well as the 'real'
constructor, but in my code I'd forgotten to implement RootClass(void),
instead seeing the 'real' constructor and not realising I was missing
one :-(

So of course when I came to construct a subclass the code compiled okay
because the (void) constructor was declared in the .h file, but the
linker couldn't find the symbol because the function wasn't actually

Thanks for your help guys, it did help me track down this rather obvious
problem, so sorry about it being something so simple!

Also Paul, in reference to your earlier comment:

> The '_ZN8RootClassC2Ev' is not a valid mangled symbol at all;

That's my fault too - I didn't realise how name mangling worked, and I
changed the name of the class to match the description I'd given earlier
(my *intention* was to avoid confusion - ha!)  The actual name of the
real class is only eight characters long, so the symbol was originally
correct until I mangled it a bit too much ;-)  Sorry about that!

Anyway, thanks again for your help, my code now compiles correctly!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]