views:

277

answers:

2

I have installed GCC and GTK+. Its working fine, but i need to statically link GTK+ libraries with my application (its a small application) so that there exist only one '.exe'. Can anybody suggest a solution for this problem...?

A: 

The correct answer would be two words: not supported. Really, if you want to distribute your application, being it 2 or 100000 lines, just bind a copy of GTK+ with it.

ntd
+4  A: 

It is supported with a few minor issues (like having trouble finding configuration files), but you will have to compile GTK+ yourself! (the default binaries do not include static libraries)

See this mailing-list thread for more information on this issue.

FX
No, it is not. Read the full thread you linked, expecially the Tor Lillqvist comments (mantainer of the windows port).
ntd
Tor points to two issues: Gtk+ finding 2. its message catalogs, and 1. its configuration files. To avoid configuration files, you can hard-code your configuration in the program, with calls to gtk_rc_parse_string. For the message catalogs, you can ship with them if you accept to loose internationalization.So, while not a perfect solution, it can be hacked.
FX
These are not little issues and the thread was pure theoretical discussion. Anyway with the current GTK+ codebase (and this includes the build system) it is **not** possible. Otherwise, please, point me out to a single application linked against a GTK+ static library.
ntd
I have built some statically-linked, relocatable apps on my mac (against Gtk+-2.10, without i18n). It requires hacking, but it is not impossible.
FX
In maths, proofs of inexistence are sometimes easier than proofs of existence. In real life, though...
FX