Re: gtk-2.3.0 build problem. prefix!=/usr but libtool uses /usr/lib/*

On Sat, 22 Nov 2003 23:16:14 +0200
Yotam Medini <yotam_medini fastmail fm> wrote:

> Tried to build gtk-2.3.0 installing it under --prefix=/home/local.
> I manage to build and install glib and pango, using 
>    LDFLAGS=-L$(prefix)/lib CPPFLAGS=-I$(prefix)/include
> Then proceedded to gtk also using 
>   PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig:/usr/lib/pkgconfig.
> Note that I have put /home/local  _before_  /usr.
> Gtk+'s configure seem to run fine, but when compiling I got
> ...
> make[5]: Entering directory `/home/local/src/gtk/gtk+-2.3.0/gtk'
> /bin/sh ../libtool --mode=link gcc  -g -O2 -g -Wall  -L/home/local/lib
> -o gtk-query-immodules-2.0  queryimmodules.o
> ../gdk-pixbuf/ ../gdk/ gcc -g -O2
> -g -Wall -o .libs/gtk-query-immodules-2.0 queryimmodules.o 
> -L/home/local/lib ./.libs/
> /home/local/src/gtk/gtk+-2.3.0/gdk/.libs/
> -L/usr/X11R6/lib /usr/lib/ /usr/lib/
> /usr/lib/ /usr/lib/
> ../gdk-pixbuf/.libs/
> ../gdk/.libs/ -lXrandr -lXinerama -lXext -lXft
> -lXrender /usr/lib/ /usr/lib/ -lz
> /usr/lib/ -lX11 -lXcursor
> /home/local/lib/ /home/local/lib/
> /home/local/lib/
> /home/local/src/gtk/gtk+-2.3.0/gdk-pixbuf/.libs/
> /home/local/lib/ -ldl
> /home/local/lib/ /home/local/lib/ -lm
> -Wl,--rpath
> -Wl,/home/local/lib/home/local/src/gtk/gtk+-2.3.0/gdk/.libs/libgdk-x1
> undefined reference to
> `g_unsetenv'./.libs/ undefined reference to
> `g_type_instance_get_private'./.libs/ undefined
> reference to
> `g_param_spec_get_redirect_target'./.libs/ undefined
> reference to
> `g_object_class_override_property'./.libs/ undefined
> reference to `g_type_class_add_private'./.libs/
> undefined reference to `g_object_interface_install_property' collect2:
> ld returned 1 exit status make[5]: *** [gtk-query-immodules-2.0] Error
> 1 make[5]: Leaving directory `/home/local/src/gtk/gtk+-2.3.0/gtk'
> ....
> So far, i did not figure out why libtool decided to use 
>    /usr/lib/ /usr/lib/ 
> while having
>    /home/local/lib/
>    /home/local/lib/
> installed. It does refer to them in the link line, but 'too late'
> after the current incompatible of /usr/lib were used.

The problem here is the .la files I think. Since GTK is linked to ATK
and pango, the .la files of ATK and pango are read by libtool. But
because you had the old version of glib then you installed ATK and/or
pango, the path to the old version of glib (/usr/lib) is contained in
these .la files.

I don't know the "right" solution to this problem. But you can edit the
.la files in question to point to the new location (/usr/local/lib), but
that can become quite cumbersome in the long run. What I personally do
is to delete all .la files, but since I know that is discouraged I will
not recommend it to anyone. (I have never understood the whole point of
the .la files, they only cause trouble, but they are probably good for

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