[Top][All Lists]

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

Re: Link error for blahS.c when used in multiple GCC environment.

From: Brendon Costa
Subject: Re: Link error for blahS.c when used in multiple GCC environment.
Date: Tue, 03 Apr 2007 08:21:05 +1000
User-agent: Thunderbird (Windows/20070221)

Ralf Wildenhues wrote:
> * Brendon Costa wrote on Mon, Apr 02, 2007 at 11:42:29PM CEST:
>> Ok, I installed libtool 1.5.23b and re-bootstrapped my example project.
> Thanks for all the data.  Upon reading, I'm a bit embarassed to see that
> I could have asked a better question earlier; sorry about that.
>> /usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=link g++  -g -O2
>> -L/home/bcosta/gcc/install/lib -o library_user  library_user-main.o
>> ../../../src/libs/myshared/
>> ../../../src/libs/mystatic/ ../../../libltdl/
>> -dlopen ../../../src/plugins/myplugin/
> Am I right in that you have both a static and a shared library that both
> link against libstdc++?  If yes, why are you doing this (the static lib)?
> I bet it's the libstdc++.a coming into play...

They are both C++ libraries yes. I do not tell either of them to link
with libstdc++ explicitly. The linking lines for the libs are below.

There is no mention of libstdc++ in the linking of libmystatic. There is
however a reference to libstdc++ while linking libmyshared which is
added in by libtool. This should be normal behavior shouldn't it?

/usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=link g++  -g -O2
-L/home/bcosta/gcc/install/lib -o -rpath /usr/local/lib
-static libmystatic_la-mystatic.lo
ar cru .libs/libmystatic.a  libmystatic_la-mystatic.o
ranlib .libs/libmystatic.a
(cd .libs && rm -f && ln -s ../

/usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=link g++  -g -O2
-L/home/bcosta/gcc/install/lib -o -rpath /usr/local/lib
g++ -shared -nostdlib /usr/lib/crti.o
 .libs/libmyshared_la-myshared.o  -Wl,--rpath
-Wl,/home/bcosta/gcc/install/lib -Wl,--rpath
-Wl,/home/bcosta/gcc/install/lib -L/home/bcosta/gcc/install/lib
-L/home/bcosta/gcc/build/gcc -lm
/usr/lib/crtn.o  -Wl,-soname -Wl, -o
(cd .libs && rm -f && ln -s
(cd .libs && rm -f && ln -s
ar cru .libs/libmyshared.a  libmyshared_la-myshared.o
ranlib .libs/libmyshared.a
(cd .libs && rm -f && ln -s ../

reply via email to

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