Re: static linking on mingw/msys



On Sat, 2006-10-14 at 10:12 +0200, Martin Schmeisser wrote:


On 10/14/06, Michael Torrie <torriem chem byu edu> wrote:
        On Fri, 2006-10-13 at 21:10 +0200, Martin Schmeisser wrote:
        > Hi List,
        >
        > i tried to compile a rather simple Gtkmm app with static
        linking for Windows
        > platforms (compiling on a win box too). I used Mingw/Msys
        and the 
        > gtkmm-devel and gtk-devel installers from the net.
        > I can compile my app with dynamic linking without any
        errors :
        
        Gtk+ cannot be statically linked on Windows.


Hehe, darn, thats why.  So is there a way to find out what dlls it
linked againts? I dont want my dad to intall the gtk runtime on about
20 boxes he is going to use this app on, so maybe i can just put the
dlls in the same folder as the binary? 

Yeah gtk dynamically loads other dlls at runtime anyway, so even it was
possible to statically link gtk, it still would require other dlls.

The way I would ship my app is to bundle all the gtk dlls and supporting
directory structure in the same folder as your app's executable.  So
besides the dlls you'll need supporting config files, etc.  What I'd do
is install the gtk runtime .exe that goes along with the gimp's win32
package (see www.gimp.org for a link to the win32 installer package).
Then using those files, make your own directory structure:

<folder>
 - your exe
 - all the dlls from gtk runtime/bin
 + etc (from runtime/etc)
 + share
 + lib

Then zip it all up and you should be away to the races.  GTK dlls always
look for the etc, lib, share directories right off the directory where
the dlls were originally loaded.

Michale



thanks again, Martin




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