I have installed GCC and GTK+. Its working fine, but i need to statically link GTK+ libraries with my application (it's a small application) so that there exist only one '.exe'.
Asked
Active
Viewed 8,953 times
3 Answers
6
mingw-cross-env has fixes to build gtk and all related libs statically

Martin Gerhardy
- 1,860
- 22
- 13
5
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.

F'x
- 12,105
- 7
- 71
- 123
-
No, it is not. Read the full thread you linked, expecially the Tor Lillqvist comments (mantainer of the windows port). – ntd Mar 13 '10 at 21:55
-
2Tor 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. – F'x Mar 13 '10 at 23:21
-
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 Mar 14 '10 at 10:43
-
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. – F'x Mar 14 '10 at 14:02
-
3In maths, proofs of inexistence are sometimes easier than proofs of existence. In real life, though... – F'x Mar 14 '10 at 14:03
4
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
- 7,372
- 1
- 27
- 44