Re: Problems with GNU linker
On 11/3/2010 11:28 AM, luca wrote:
Hi,
i have a problem with linking under linux. I have written a C++
library and
a C++ program that uses that library (i use Eclipse IDE under Mandriva
under Virtual Box..).
I succesfully compile the library, obtaining the file libfvlib.a (one
under the Debug directory,
the other under the Release directory).
After that, i have created a new C++ project that uses that library.
I have added the library path of the debug (release) version of
libfvlib.a for the debug (release) version
of the program. I have added the .a file with -l option (to be used in
the linking process).
My program compiles but does not link. I obtain this error:
**** Build of configuration Debug for project pmrplib ****
make all
Building target: pmrplib
Invoking: GCC C++ Linker
g++ -L/home/luca/Sviluppo/projects/pmrplib/fvlib/Debug -o"pmrplib" ./
cpmrplib.o ./cpmrp.o ./main.o -llibfvlib.a
/usr/bin/ld: cannot find -llibfvlib.a
Try putting that command line option *before* the first .o file in your
list. And next time do ask in the newsgroup where this is on topic,
like 'gnu.gcc.help'.
And do 'man g++' every morning for about fifteen minutes.
collect2: ld returned 1 exit status
make: *** [pmrplib] Error 1
[...]
V
--
I do not respond to top-posted replies, please don't ask