[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 1.5.0.10 (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/libmyshared.la
>> ../../../src/libs/mystatic/libmystatic.la ../../../libltdl/libltdlc.la
>> -dlopen ../../../src/plugins/myplugin/myplugin.la
>
> 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 libmystatic.la -rpath /usr/local/lib
-static libmystatic_la-mystatic.lo
ar cru .libs/libmystatic.a libmystatic_la-mystatic.o
ranlib .libs/libmystatic.a
creating libmystatic.la
(cd .libs && rm -f libmystatic.la && ln -s ../libmystatic.la libmystatic.la)
/usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=link g++ -g -O2
-L/home/bcosta/gcc/install/lib -o libmyshared.la -rpath /usr/local/lib
libmyshared_la-myshared.lo
g++ -shared -nostdlib /usr/lib/crti.o
/home/bcosta/gcc/install/lib/gcc/i386-unknown-netbsdelf3.0/4.0.1/crtbeginS.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/install/lib/gcc/i386-unknown-netbsdelf3.0/4.0.1
-L/home/bcosta/gcc/install/lib/gcc/i386-unknown-netbsdelf3.0/4.0.1/../../..
/home/bcosta/gcc/install/lib/libstdc++.so
-L/home/bcosta/gcc/build/i386-unknown-netbsdelf3.0/libstdc++-v3/src
-L/home/bcosta/gcc/build/i386-unknown-netbsdelf3.0/libstdc++-v3/src/.libs
-L/home/bcosta/gcc/build/gcc -lm
/home/bcosta/gcc/install/lib/gcc/i386-unknown-netbsdelf3.0/4.0.1/crtendS.o
/usr/lib/crtn.o -Wl,-soname -Wl,libmyshared.so.0 -o
.libs/libmyshared.so.0.0
(cd .libs && rm -f libmyshared.so.0 && ln -s libmyshared.so.0.0
libmyshared.so.0)
(cd .libs && rm -f libmyshared.so && ln -s libmyshared.so.0.0
libmyshared.so)
ar cru .libs/libmyshared.a libmyshared_la-myshared.o
ranlib .libs/libmyshared.a
creating libmyshared.la
(cd .libs && rm -f libmyshared.la && ln -s ../libmyshared.la libmyshared.la)