This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ld problems
- From: Mattias Jansson <mattias at realityrift dot com>
- To: binutils at sources dot redhat dot com
- Date: Sat, 11 Sep 2004 16:30:15 +0200
- Subject: ld problems
- Organization: Reality Rift Studios
Please excuse me if this is the wrong place for this kind of questions,
but I've been banging my head against this particular wall for a while
now, and don't think I'll find a solution on my own.
I am linking a a program consisting of a single C++ object file (a test
suite) with a rather large static library also written in C++ (my 3D
game engine). Everything has worked fine for quite some time, but
recently I started getting an annoying error during the link phase of
the program (compiling the static library archive itself is just fine,
no problems there). The error I'm getting is
g++ -o build/scons/debug/test/test-font-debug
build/scons/debug/test/font/application.o -Lbuild/scons/debug/engine
-Lsrc -L/usr/X11R6/lib -lneoapplication-debug -lneoengine-debug -lGL
-lXxf86vm -lX11
typeinfo for neo::scene::Object: discarded in section
`.gnu.linkonce.r._ZTIN3neo5scene6ObjectE' from
build/scons/debug/engine/libneoengine-debug.a(object.o)
collect2: ld returned 1 exit status
where 'libneoengine-debug.a' is the engine static library archive.
I have searched for a better description of the problem and what to do
about it, but can't seem to find anything.
The problem goes away if I rename the neo::scene::Object class to
something else, but that's not a solution.
It also goes away if I add a --whole-archive / --no-whole-archive block
around -lneoengine-debug, but that sounds like a hack rather than a
solution to me.
Does anybody have an idea of what the problem might be and how to fix
it? Or simply describe this error in more detail to point me in the
right direction? If you need more information or the source, just tell
me.
Thanks!
/ Mattias