> > Ideally I'd like to statically compile this program and eliminate messing with
> > an end user's LD_LIBRARY_PATH. However, when statically compiling I get the
> > following error message;
> > "ld: Undefined symbol
> > _dlsym
> > _dlopen
> > _dlclose
> > _dlerror
> > collect2: ls returned 2 exit status".
> > Any thoughts on what might be causing this?
> *However*, it shouldn't be necessary to force end users to prepend the
> local X11R5 installation directory in order to run dynamically-linked
> GTK+ programs; you just have to ensure that all GTK+ programs are linked
> with the flag "-L<X11R5 library directory>", e.g.
> "-L/usr/local/X11R5/lib" if that's where the X11R5 libraries are
> installed.
This is a horrible problem for me too (if I've understood what you're
saying correctly).
The workaround I use is to hack about with the final makefile produced
by autoconf. Look for the link line, for one of my apps, it's this:
LDADD = ${top_srcdir}/libsrc/libvips.la -lxil \
-lgen -lXm -lXt -lXmu -L/usr/local/lib \
-L/usr/openwin/lib -R/usr/openwin/lib \
-lgtk -lgdk -lgmodule -lglib -ldl -lXext \
-lX11 -lsocket -lnsl -lm -lXpm -lSM -lICE \
-lSM -lICE -ltiff -lz -ljpeg -lm \
-lpthread -ldl
The `gtk-conf` stuff is expanded earlier. This app is about halfway
between being moved from Motif to gtk, which is partly why this list is
so awful.
I now go though the link line, and make all non-standard libraries
static to get this:
LDADD = -L/usr/X11R6/lib -L/usr/local/lib \
../../../libsrc/.libs/libvips.so \
-lxil -lgen -lXm \
-lXt -lXmu \
-Bstatic -lgtk -lgdk -lgmodule -lglib -Bdynamic \
-ldl -lXext -lX11 -lsocket -lnsl \
-Bstatic -lXpm -Bdynamic \
-lSM -lICE \
-Bstatic -ltiff -ljpeg -lz -Bdynamic \
-lm -lpthread -ldl
I guess your non-standard libs will include most of X as well.
I wish there was some way to do this automatically, but I don't think
there is :-(
John
--
John Cupitt, [EMAIL PROTECTED], +44 (0)20 7747 2570
VASARI Lab, The National Gallery, Trafalgar Square, London, WC2N 5DN
--
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null