This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ld problems


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]