Re: static linking

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

 



On 5/4/05, riboaz@xxxxxxxxx <riboaz@xxxxxxxxx> wrote:
> how does one link a gtk+ application (v2.6.2) as a static executable?

You need to build the static gtk libs first. I do:

% cd glib
% ./configure --enable-static
% cd pango
% ./configure --enable-static --with-included-modules=basic-fc
% cd atk
% ./configure --enable-static
% cd gtk+
% ./configure --enable-static --without-libtiff --disable-modules \
              --with-included-loaders=xpm,png

then build your app as usual, but hand-edit the Makefile it generates.
Look for LDADD and chop it about to reference libgthing.a instead of
-lgthing.

It does sort-of work. But internationalisation, themeing, etc. will
not work very well, you'll gets lots of annoying warnings on platforms
which do have gtk+ installed (since your static libs will try to load
any stuff they find in /etc/font.conf or whatever as well as their
included modules), and you'll find you have more dependencies than you
thought you did (do you depend on fontconfig even though you don't
link against it?). All very frustrating.

My best portability experiences are offering ebuilds or .debs and
asking users to make their own.

John
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux