help-gplusplus
[Top][All Lists]
Advanced

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

Re: Undefined symbol when loading g++ created library


From: Paul Pluzhnikov
Subject: Re: Undefined symbol when loading g++ created library
Date: Sun, 27 Nov 2005 18:19:54 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Adam Nielsen <address@hidden> writes:

> The constructor is implemented in the main executable, e.g.
>
>   g++ -o main Main.o RootClass.o
>
> But I imagine it's the same situation.

Actually, it isn't.

There is a big difference between linking RootClass.o and linking
libmumble.a; you can read all about it here:

  http://webpages.charter.net/ppluzhnikov/linker.html

What Robert meant to tell you is that the librarian may not take
RootClass.o "fook" from the libmumble.a "shelf" at all (if none of
the RootClass.o code is referenced by any of your other objects).

But of course, your mistake was even simpler :)

> Is there a way I can link things so this code would be included?

The way you are doing it is fine (provided RootClass.o contains
the necessary code).

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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