help-gplusplus
[Top][All Lists]
Advanced

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

linker problems


From: Joerg Schaber
Subject: linker problems
Date: Fri, 08 Dec 2006 17:53:42 +0100
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Hi,

I'm trying to compile and link a cpp-file with the following commandline options:

g++ -I/libpath/ -lmylib  p.cpp

the compiling step succeded, but the linking step fails with this error message:

/tmp/ccqLyDUW.o(.text+0x124): In function `main':
: undefined reference to `CVersion::CVersion()'
/tmp/ccqLyDUW.o(.text+0x147): In function `main':
: undefined reference to `CVersion::setVersion(long, long, long)'
/tmp/ccqLyDUW.o(.text+0x18e): In function `main':
: undefined reference to `CVersion::~CVersion()'
/tmp/ccqLyDUW.o(.text+0x1a7): In function `main':
: undefined reference to `CVersion::~CVersion()'
collect2: ld returned 1 exit status


I checked with this line "nm -C libmylib.a | grep CVersion", whether the function "CVersion" is contained in the ibmylib.a.
Is it, but the linker won't find it anyway ...

I got a hint, that there's a command line option which forces the linker to search multiple times through the libraries instead of one time, but I can't find it. Has somebody a idea which is the command line option I need? Or maybe another solution?

Thanks a lot


reply via email to

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