Re: Statically linked GTK app
- From: John Cupitt <john cupitt ng-london org uk>
- To: Raymond Wan <rwan cs mu oz au>
- Cc: gtk-list gnome org
- Subject: Re: Statically linked GTK app
- Date: Tue, 30 Oct 2001 12:29:08 +0000
Hi Raymond, I think this happens because under Linux the dynamic linker
does not work in statically linked executables. If you want to use
dlopen()/dlsym()/etc. (these are the calls wrapped by gmodule on linux),
you must, at a minimum, link dynamically against libc and libdl.
I sort of remember there was some talk of changing gmodule so that it
wrapped libltdl instead. I think this would fix this problem ... but
until (if?) this change is made, it's not possible to have a completely
static GTK 1.3 program.
John
(erm, corrections very welcome if I've messed up here)
Raymond Wan wrote:
I would like everything linked in (not just GTK), so I've added
"-static" at the end of line that does the linking. It all links fine
(except that I had to archive (ar) all of the atk .o files into a .a file
and place it in a directory where the linker could find it...not sure why
this did not happen to the other packages but only to atk).
When I run the executable, I get this error message:
** WARNING **: Error loading XPM image loader: Unable to load
image-loading module:
/home/rwan/gtk/lib/gtk-2.0/1.3.5/loaders/libpixbufloader-xpm.so:
couldn't open libtool archive
Gtk-CRITICAL **: file gtkpixmap.c: line 99 (gtk_pixmap_new): assertion
`val != NULL' failed
... [error messages repeat a bit] ...
Gtk-CRITICAL **: file gtkwidget.c: line 1571 (gtk_widget_show): assertion
`widget != NULL' failed
Cannot load module
/home/rwan/gtk/lib/pango/modules/pango-basic-x.so: couldn't open
libtool archive
... [these error messages repeat too] ...
And then my program segmentation faults. Before running my
executable, I ran "ldd" on it and it said it was "not a dynamic
executable". And of course, the static version runs fine, so these files
(libpixbufloader-xpm.so and pango-basic-x.so) do exist.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]