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
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to