help-gplusplus
[Top][All Lists]
Advanced

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

Re: linker problems


From: Vipin Dravid
Subject: Re: linker problems
Date: Sat, 9 Dec 2006 02:25:14 +0530

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

try changing this to:

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

On 12/8/06, Joerg Schaber <schaber@molgen.mpg.de> wrote:
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



--
Regards,
V i p i n

"Life is too short to let it pass you by,
we have only one shot at this and then it's gone."
-- Erma Bombeck




reply via email to

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