libtool
[Top][All Lists]
Advanced

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

Library order in gcc command


From: Arvid Brodin
Subject: Library order in gcc command
Date: Mon, 09 Jul 2007 14:44:44 +0200
User-agent: Thunderbird 2.0.0.4 (X11/20070703)

I am doing a test installation of GTK+ on top of DirectFB (instead of on X11). 
(I'm later going to cross compile this for an embedded system.) Now, GTK+ 
depends on Cairo, and Cairo in turn is compiled with support for either X11 or 
DirectFB as graphics backend. I'm installing everything to a separate directory 
(using ./configure --prefix=/home/install_dir), and that is where the DirectFB 
version of the Cairo libraries end up (in subdir lib/). I'm normally running 
X11 on this system, so an X11 version of the Cairo library is already installed 
in /usr/lib64. 

libtool is used by make to generate commands for building GTK+. libtool finds 
both versions of the Cairo library, but unfortunately it places the /usr/lib64 
one first, and that makes the linker fail with undefined references. (If I run 
the command by hand, removing the /usr/lib64/libcairo.so reference, the command 
works fine, but there are many files to compile/link and I would like a better 
solution.)


This is what is printed by make:

/bin/sh ../libtool --mode=link gcc  -DG_DISABLE_DEPRECATED -g -O2 -Wall   -o 
gtk-query-immodules-2.0  queryimmodules.o libgtk-directfb-2.0.la 
../gdk-pixbuf/libgdk_pixbuf-2.0.la ../gdk/libgdk-directfb-2.0.la 
gcc -DG_DISABLE_DEPRECATED -g -O2 -Wall -o .libs/gtk-query-immodules-2.0 
queryimmodules.o  ./.libs/libgtk-directfb-2.0.so 
-L/home/install_dir/usr/local//lib 
/home/install_dir/source/gtk+-2.10.13/gdk/.libs/libgdk-directfb-2.0.so 
-L/home/install_dir/usr/local/lib /home/install_dir/usr/local/lib/libatk-1.0.so 
../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so ../gdk/.libs/libgdk-directfb-2.0.so 
/home/install_dir/usr/local//lib/libpangocairo-1.0.so /usr/lib64/libcairo.so 
/usr/lib64/libglitz.so /usr/lib64/libXrender.so /usr/lib64/libX11.so 
/usr/lib64/libXau.so /usr/lib64/libXdmcp.so 
/home/install_dir/usr/local//lib/libpangoft2-1.0.so 
/home/install_dir/usr/local//lib/libpango-1.0.so 
/home/install_dir/usr/local//lib/libcairo.so /usr/lib64/libfontconfig.so 
/usr/lib64/libfreetype.so /usr/lib64/libxml2.so 
/home/install_dir/usr/local//lib/libdirectfb.so 
/home/install_dir/usr/local//lib/libfusion.so 
/home/install_dir/usr/local//lib/libdirect.so -lpthread /usr/lib64/libpng12.so 
-lz /home/install_di
r/source/gtk+-2.10.13/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so 
/home/install_dir/usr/local//lib/libgmodule-2.0.so -ldl 
/home/install_dir/usr/local//lib/libgobject-2.0.so 
/home/install_dir/usr/local//lib/libglib-2.0.so -lm -Wl,--rpath 
-Wl,/home/install_dir/usr/local/lib -Wl,--rpath 
-Wl,/home/install_dir/usr/local//lib
/home/install_dir/source/gtk+-2.10.13/gdk/.libs/libgdk-directfb-2.0.so: 
undefined reference to `cairo_directfb_surface_create'
collect2: ld returned 1 exit status

I have set LD_LIBRARY_PATH=/home/install_dir/lib - is this where libtool gets 
the path to the correct library? And most importantly, how do I get libtool to 
place the correct library before the /usr/lib64/libcairo.so one so that the 
link does not fail?

Some system info:
$ uname -a
Linux shuttle 2.6.18-gentoo-r6 #3 Mon Jan 1 16:52:53 CET 2007 x86_64 AMD 
Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux


Thanks
Arvid




reply via email to

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