Re: Statically Linking GTK+ libraries with Win32 in MS VC++

On Thu, 2004-09-16 at 07:58, Matthew Yaconis wrote:
I've managed to port some libraries I've generated and a GTK+
application from Linux to Windows XP, using MS Visual C++ 6.0. 
However, being quite new to the MS Visual C++ and Win32 programming in
general, in attempting to distribute the new windows application to
some co-workers found out that my executable depends on at least the
libgtk-win32-2.0-0.dll, and as a result won't run on machines that
don't have some of the distributions listed on Tor's website.  I
thought I was linking statically with all the required libraries,
allowing the executable to be moved from one Win32 box to another, but
obviously I did something wrong.  

Does anyone have some advice on how to specify static linking with
GTK+ libraries in MS Visual C++ so the application can be run on most
any workstation?  Or do I have to have some sort of installation so it
will properly run?

Statically linking gtk on win32 just doesn't work.  This is because GTK
is designed to work exclusivly with DLLs.  The reason for this is that
on Windows there is no set directories like /etc or /share, so GTK has
to have a method for defining where these directories (which gtk uses)
are placed.  The current method for this is to look for them relative to
the gtk dlls.  This is an ideal solution because it allows for multiple
installation locations of gtk and for apps to bundle the dlls with
themselves in their Program files directory.

So the short answer is don't worry about statically linking.  It won't
buy you anything.  Even if you did (presumably to make a single exe)
you'd still have to have a /etc and /share (to say nothing of the image
loaders).  So you wouldn't gain anything.

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
Michael L Torrie <torriem chem byu edu>

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