[Gtkradiant] Static vs. dynamic Windows libraries

Nerius Landys nlandys at gmail.com
Fri Jan 28 16:04:57 CST 2011


I came across some questions while compiling libjpeg for Radiant.

I found this explanation of static vs. dynamic libraries:
http://www.learncpp.com/cpp-tutorial/a1-static-and-dynamic-libraries/ .

So apparently, a .lib file in Windows can be either a static or dynamic
library.  If it's a dynamic library, a .dll file is required for running the
application.  If it's a static .lib file, the .lib file will be "slightly
larger" because it includes the code, and a ..dll won't be required.

So now I have a few questions.  How do you find out if a .lib file is a
static or dynamic library?

And the question of whether or not a library is "baked in" to your exe, or
if a library will require a .dll at runtime - this is purely a function of
the type of .lib used to compile your application, right?  (Meaning, it's a
function of whether the .lib is static or dynamic).

I don't want to bundle more .dll files than I have to with Radiant, and it
would be nice to know which of the libraries are "baked in" to the .exe
files.

In particular, I'm wondering whether or not the .lib files found in this
Gtk+ bundle are static or dynamic:
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.6-20100912_win32.zip(linked
from:
http://www.gtk.org/download-windows.html).  This bundle does include many
.dll files, all of which I'm copying to the install folder.

As far as libjpeg goes, it appears that the normal way to use this is as a
static library (and I see that config.py in Radiant in fact does _not_ copy
libjpeg.dll into the install folder, which verifies my theory).

Answers, thoughts, and comments much appreciated.

- Rambetter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://zerowing.idsoftware.com/pipermail/gtkradiant/attachments/20110128/72207552/attachment.htm 


More information about the Gtkradiant mailing list