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 libgtk-x11-2.0.la
> ../gdk-pixbuf/libgdk_pixbuf-2.0.la ../gdk/libgdk-x11-2.0.la gcc -g -O2
> -g -Wall -o .libs/gtk-query-immodules-2.0 queryimmodules.o 
> -L/home/local/lib ./.libs/libgtk-x11-2.0.so
> /home/local/src/gtk/gtk+-2.3.0/gdk/.libs/libgdk-x11-2.0.so
> -L/usr/X11R6/lib /usr/lib/libatk-1.0.so /usr/lib/libgobject-2.0.so
> /usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so
> ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so
> ../gdk/.libs/libgdk-x11-2.0.so -lXrandr -lXinerama -lXext -lXft
> -lXrender /usr/lib/libfontconfig.so /usr/lib/libfreetype.so -lz
> /usr/lib/libexpat.so -lX11 -lXcursor
> /home/local/lib/libpangoxft-1.0.so /home/local/lib/libpangox-1.0.so
> /home/local/lib/libpango-1.0.so
> /home/local/src/gtk/gtk+-2.3.0/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so
> /home/local/lib/libgmodule-2.0.so -ldl
> /home/local/lib/libgobject-2.0.so /home/local/lib/libglib-2.0.so -lm
> -Wl,--rpath
> -Wl,/home/local/lib/home/local/src/gtk/gtk+-2.3.0/gdk/.libs/libgdk-x1
> 1-2.0.so: undefined reference to
> `g_unsetenv'./.libs/libgtk-x11-2.0.so: undefined reference to
> `g_type_instance_get_private'./.libs/libgtk-x11-2.0.so: undefined
> reference to
> `g_param_spec_get_redirect_target'./.libs/libgtk-x11-2.0.so: undefined
> reference to
> `g_object_class_override_property'./.libs/libgtk-x11-2.0.so: undefined
> reference to `g_type_class_add_private'./.libs/libgtk-x11-2.0.so:
> 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/libgmodule-2.0.so /usr/lib/libglib-2.0.so 
> while having
>    /home/local/lib/libgobject-2.0.so
>    /home/local/lib/libglib-2.0.so
> 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
something.)



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