Discussion:
help compiling gnome-vfs-2.18.1
John Goulah
2008-03-31 01:54:10 UTC
Permalink
I'm trying to get gnome-vfs installed, I have the apt installed glib
in /usr/local and my compiled glib-2.14.5 in /usr/local/lib -- I want
it to use the latter, how do I force that? I'm getting:

gcc -g -O2 -o .libs/gnome-vfs-daemon dbus-utils.o vfs-daemon.o
daemon-connection.o -pthread -L/cuttingedge/lib
-L/usr/local/lib/libglib-2.0.so -L/usr/local/lib -L/cuttingedge//lib
../libgnomevfs/.libs/libgnomevfsdaemon-2.a
/cuttingedge//lib/libhal-storage.so /cuttingedge//lib/libhal.so
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so
../libgnomevfs/.libs/libgnomevfs-2.so /usr/lib/libgconf-2.so
/usr/lib/libORBit-2.so /usr/lib/libgmodule-2.0.so
/usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so
/usr/lib/libglib-2.0.so -lm /usr/local/lib/libgmodule-2.0.so -ldl
/usr/local/lib/libgthread-2.0.so -lpthread /usr/lib/libxml2.so
/usr/local/lib/libdbus-glib-1.so -lnsl -ldbus-1
/usr/local/lib/libgobject-2.0.so -lssl -lcrypto
/usr/lib/libavahi-glib.so /usr/local/lib/libglib-2.0.so
/usr/lib/libavahi-common.so /usr/lib/libavahi-client.so -lresolv
-lutil -lrt -Wl,--rpath -Wl,/cuttingedge//lib
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so:
undefined reference to `g_once_init_leave'
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so:
undefined reference to `g_once_init_enter_impl'
collect2: ld returned 1 exit status


I tried to force in the Makefile to the /usr/local/lib version (I'm
sure there is a better way) by replacing -lglib-2.0 with
-l/usr/local/lib/libglib-2.0.so.0. That didn't do the trick, but I'm
pretty confident thats what I need since that function does exist in
the symbol table for the one in /usr/local but not the one in /usr:

$ readelf -s /usr/lib/libglib-2.0.so | grep g_once_init_leave
$ <nothing>

$ readelf -s /usr/local/lib/libglib-2.0.so.0 | grep g_once_init_leave
345: 00051140 238 FUNC GLOBAL DEFAULT 10 g_once_init_leave
2895: 00051140 238 FUNC LOCAL HIDDEN 10 IA__g_once_init_leave
3456: 00051140 238 FUNC GLOBAL DEFAULT 10 g_once_init_leave


Can someone get me back on track?


Thanks!
John
John Goulah
2008-03-31 22:04:04 UTC
Permalink
Post by John Goulah
I'm trying to get gnome-vfs installed, I have the apt installed glib
in /usr/local and my compiled glib-2.14.5 in /usr/local/lib -- I want
gcc -g -O2 -o .libs/gnome-vfs-daemon dbus-utils.o vfs-daemon.o
daemon-connection.o -pthread -L/cuttingedge/lib
-L/usr/local/lib/libglib-2.0.so -L/usr/local/lib -L/cuttingedge//lib
../libgnomevfs/.libs/libgnomevfsdaemon-2.a
/cuttingedge//lib/libhal-storage.so /cuttingedge//lib/libhal.so
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so
../libgnomevfs/.libs/libgnomevfs-2.so /usr/lib/libgconf-2.so
/usr/lib/libORBit-2.so /usr/lib/libgmodule-2.0.so
/usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so
/usr/lib/libglib-2.0.so -lm /usr/local/lib/libgmodule-2.0.so -ldl
/usr/local/lib/libgthread-2.0.so -lpthread /usr/lib/libxml2.so
/usr/local/lib/libdbus-glib-1.so -lnsl -ldbus-1
/usr/local/lib/libgobject-2.0.so -lssl -lcrypto
/usr/lib/libavahi-glib.so /usr/local/lib/libglib-2.0.so
/usr/lib/libavahi-common.so /usr/lib/libavahi-client.so -lresolv
-lutil -lrt -Wl,--rpath -Wl,/cuttingedge//lib
undefined reference to `g_once_init_leave'
undefined reference to `g_once_init_enter_impl'
collect2: ld returned 1 exit status
I tried to force in the Makefile to the /usr/local/lib version (I'm
sure there is a better way) by replacing -lglib-2.0 with
-l/usr/local/lib/libglib-2.0.so.0. That didn't do the trick, but I'm
pretty confident thats what I need since that function does exist in
$ readelf -s /usr/lib/libglib-2.0.so | grep g_once_init_leave
$ <nothing>
$ readelf -s /usr/local/lib/libglib-2.0.so.0 | grep g_once_init_leave
345: 00051140 238 FUNC GLOBAL DEFAULT 10 g_once_init_leave
2895: 00051140 238 FUNC LOCAL HIDDEN 10 IA__g_once_init_leave
3456: 00051140 238 FUNC GLOBAL DEFAULT 10 g_once_init_leave
Can someone get me back on track?
I'm starting to wonder if this list is even active? Nobody knows how
to override the default glib location?
Hans Petter Jansson
2008-04-01 04:46:00 UTC
Permalink
Post by John Goulah
I'm trying to get gnome-vfs installed, I have the apt installed glib
in /usr/local and my compiled glib-2.14.5 in /usr/local/lib -- I want
Try:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

And then configure, clean and make gnome-vfs anew. This pkg-config
mechanism is not unique to gnome-vfs, btw - you'll find most
GNOME-related packages use it.
--
Hans Petter
John Goulah
2008-04-05 15:51:28 UTC
Permalink
Post by Hans Petter Jansson
Post by John Goulah
I'm trying to get gnome-vfs installed, I have the apt installed glib
in /usr/local and my compiled glib-2.14.5 in /usr/local/lib -- I want
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
And then configure, clean and make gnome-vfs anew. This pkg-config
mechanism is not unique to gnome-vfs, btw - you'll find most
GNOME-related packages use it.
Hi, thanks for the advice.. I'm still getting an error, probably b/c
its trying to link both glib in /usr and /usr/local :

gcc -g -O2 -o .libs/gnome-vfs-daemon dbus-utils.o vfs-daemon.o
daemon-connection .o -pthread -L/cuttingedge/lib -L/usr/local/lib
-L/cuttingedge//lib ../libgnome vfs/.libs/libgnomevfsdaemon-2.a
/cuttingedge//lib/libhal-storage.so /cuttingedge //lib/libhal.so
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.s o
../libgnomevfs/.libs/libgnomevfs-2.so /usr/lib/libgconf-2.so
/usr/lib/libORBit -2.so /usr/lib/libgmodule-2.0.so
/usr/lib/libgobject-2.0.so /usr/lib/libgthread- 2.0.so
/usr/lib/libglib-2.0.so -lm /usr/local/lib/libgmodule-2.0.so -ldl
/usr/lo cal/lib/libgthread-2.0.so -lpthread /usr/lib/libxml2.so
/usr/local/lib/libdbus-g lib-1.so -lnsl -ldbus-1
/usr/local/lib/libgobject-2.0.so -lssl -lcrypto /usr/lib
/libavahi-glib.so /usr/local/lib/libglib-2.0.so
/usr/lib/libavahi-common.so /usr /lib/libavahi-client.so -lresolv
-lutil -lrt -Wl,--rpath -Wl,/cuttingedge//lib
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so:
undefined ref erence to `g_once_init_leave'
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.so:
undefined ref erence to `g_once_init_enter_impl'
collect2: ld returned 1 exit status


I guess what I was looking for was an env var similar to OPENSSL_LIBS,
LIBXML_LIBS, etc to explicitly force it but one for glib seems to not
exist. Any other ideas on how I can get this to build?


Thanks!

John
Hans Petter Jansson
2008-04-06 23:01:46 UTC
Permalink
Post by John Goulah
Hi, thanks for the advice.. I'm still getting an error, probably b/c
gcc -g -O2 -o .libs/gnome-vfs-daemon dbus-utils.o vfs-daemon.o
daemon-connection .o -pthread -L/cuttingedge/lib -L/usr/local/lib
-L/cuttingedge//lib ../libgnome vfs/.libs/libgnomevfsdaemon-2.a
/cuttingedge//lib/libhal-storage.so /cuttingedge //lib/libhal.so
/home/jgoulah/gnome-vfs-2.18.1/libgnomevfs/.libs/libgnomevfs-2.s o
../libgnomevfs/.libs/libgnomevfs-2.so /usr/lib/libgconf-2.so
/usr/lib/libORBit -2.so /usr/lib/libgmodule-2.0.so
/usr/lib/libgobject-2.0.so /usr/lib/libgthread- 2.0.so
/usr/lib/libglib-2.0.so -lm /usr/local/lib/libgmodule-2.0.so -ldl
/usr/lo cal/lib/libgthread-2.0.so -lpthread /usr/lib/libxml2.so
/usr/local/lib/libdbus-g lib-1.so -lnsl -ldbus-1
/usr/local/lib/libgobject-2.0.so -lssl -lcrypto /usr/lib
/libavahi-glib.so /usr/local/lib/libglib-2.0.so
/usr/lib/libavahi-common.so /usr /lib/libavahi-client.so -lresolv
-lutil -lrt -Wl,--rpath -Wl,/cuttingedge//lib
undefined ref erence to `g_once_init_leave'
undefined ref erence to `g_once_init_enter_impl'
collect2: ld returned 1 exit status
I guess what I was looking for was an env var similar to OPENSSL_LIBS,
LIBXML_LIBS, etc to explicitly force it but one for glib seems to not
exist. Any other ideas on how I can get this to build?
Well, you're linking with avahi and avahi-glib from /usr, which pulls in
the glib in /usr in addition to the one you specified. Also libORBit. I
think it should still work if you've correctly set LD_LIBRARY_PATH to
point to the glib you have installed in /usr/local/lib, but maybe your
best option is to take a look at jhbuild and build the dependencies too:

http://live.gnome.org/Jhbuild

It's not that hard to set up, and it's what most GNOME developers use
themselves.
--
Hans Petter
Loading...