[Top][All Lists]

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

Re: [Mingw-cross-env-list] Gtk static linking

From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Gtk static linking
Date: Sat, 28 May 2011 11:29:14 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Martin Gerhardy schrieb:
> maybe there should be an option to build it statically or dynamically? i
> know that the guideline for mingw-cross-env is to build everything
> statically linked, but i don't know whether this is a good idea for gtk
> and related libs. people i've asked are more or less all saying the same
> - bundle a gtk installation with your installer and don't try to link
> statically. any suggestions, thoughts or ideas about this?

You can certainly do this, but in that case you're better off using
the official GTK builds rather than those of mingw-cross-env. That is,
a switch to build a dynamically linked GTK libraries in mingw-cross-env
wouldn't be that helpful. You couldn't use the generated DLL files anyway,
because in the end of the day, your application will have to run with the
official DLLs, not with ours.

Also note that building GTK DLLs via mingw-cross-env would include the
smaller dependency libs into the DLLs, which also will almost certainly
cause trouble. That is, you would also have to build the GTK depedency
libs dynamically. I don't think this is worth the trouble, especially
since there already are official GTK builds out there.

BTW, don't be confused by the "import *.lib" files. This is what the
Microsoft tools need. For MinGW, you don't have to convert them to
"*.a" files. You don't even have to use them at all! Any modern
GCC/Binutils version is able to link directly to the *.dll files,
without any need for any intermediate "import lib" crap.

Having said that, note that I tried this successfully with some
projects, but with other libs, i.e. not with GTK. So you might run
into additional problems not yet covered here.

Nevertheless, it would be great if you could report your experiences
here. It would be great to have some section about GTK in the tutorial
that covers static as well as dynamic linking for GTK applications
in mingw-cross-env. This would finally resolve those frequently asked
questions about cross-compiling GTK applications.

In addition, it would also be great if some other mingw-cross-env
users would report their experiences with GTK here. Is anyone using
our static GTK variant successfully in some application?


Volker Grabsch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]