libtool
[Top][All Lists]
Advanced

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

libtool/ltmain linking wrong stdc++


From: Taj Morton
Subject: libtool/ltmain linking wrong stdc++
Date: Mon, 9 Oct 2006 15:07:45 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi All,
Searching the list archives, I see that other people have had this problem too,
but the solutions in those threads don't really seem to work for me...

My problem is that I have 2 compilers installed on my computer: gcc-3.4 in /usr
(system compiler), and gcc-3.3 in /opt/gcc-3.3.

When compiling /opt/gcc-3.3/bin/gcc-g++-3.3, I get link errors because
libstdc++.so is resolved to /usr/lib/libstdc++.so (the system lib), instead of
the compilers lib in /opt/gcc-3.3/lib. When I delete the /usr/lib/libstdc++.so
symlink, I get the error "Could not find /usr/lib/libstdc++.so" when linking.

The libtool command looks like this:
/bin/sh ../../../libtool --silent --tag=CXX --mode=link apg++  -Wno-long-long
-Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion
-Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security
-Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new
-fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT
-DQT_NO_TRANSLATION    -o amarok -L/opt/kde/lib -L/usr/lib/qt/lib
-L/usr/X11R6/lib    -R /opt/kde/lib -R /opt/kde/lib -R /usr/lib/qt/lib -R
/usr/X11R6/lib loader.o splash.o -lqt-mt  -lz -lpng -lz -lm -lXext -lX11  -lSM
-lICE -lpthread -lkdecore

The command passed to g++ is:
apg++ -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
-Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2
-Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor
-fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE
-DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -o amarok
loader.o splash.o -L/opt/kde/lib -L/usr/lib/qt/lib -L/usr/X11R6/lib -lm
/opt/kde/lib/libkdecore.so -L/usr/i486-slackware-linux/bin
-L/usr/i486-slackware-linux/lib
-L/usr/lib/gcc/i486-slackware-linux/../../../i486-slackware-linux/lib
-L/usr/lib/gcc/i486-slackware-linux/../.. /opt/kde/lib/libDCOP.so -lresolv
-lutil -L/usr/lib /usr/lib/libart_lgpl_2.so /usr/lib/libidn.so
/opt/kde/lib/libkdefx.so /usr/lib/qt/lib/libqt-mt.so -lfontconfig
/usr/lib/libmng.so -ljpeg -lGL -lXmu -lXrandr -lXcursor -lXinerama -lXft
/usr/X11R6/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libexpat.so
-ldl -lpng -lz -lXext -lX11 -lSM -lICE -lpthread -lXrender /usr/lib/libstdc++.so
-Wl,--rpath -Wl,/opt/kde/lib -Wl,--rpath -Wl,/usr/lib/qt/lib -Wl,--rpath
-Wl,/usr/X11R6/lib -Wl,--rpath -Wl,/opt/kde/lib -Wl,--rpath -Wl,/usr/lib/qt/lib
-Wl,--rpath -Wl,/usr/X11R6/lib

compiler_lib_search_path is "-L/opt/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.6
-L/opt/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../.."

I stuck an echo test in the "for searchdir in $newlib_search_path
$lib_search_path $sys_lib_search_path $shlib_search_path; do" loop (line 1836 of
ltmain.sh), to see what was being run through it. The libs being resolved are:
qt-mt, png, z, Xext, X11, SM, ICE, pthread, kdecore, m, resolv, util, mng,
freetype, jpeg, GL, dl, png, z, pthread. Not anything from postdeps (-lstdc++
-lm -lgcc_s -lc -lgcc_s) is being run through. The dirs being searched are:
/opt/kde/lib /usr/lib/qt/lib /usr/X11R6/lib
/home/taj/amarok-apkg/amarok-1.4.3/amarok/src/loader /opt/kde/lib
/usr/lib/qt/lib /usr/X11R6/lib /lib /usr/lib /usr/local/lib


I'm not sure where libstdc++.so is being resolved. Any ideas how I can force
libstdc++.so to be resolved to the compilers libstdc++?

Thanks!
Taj





reply via email to

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