Re: Having trouble linking to glib



Alan Mark Lemon writes:
 > I see that there are zip files like glib-2.12.1.zip that has dlls in it.
 > There are also files like glib-dev-2.12.1.zip that has header files and
 > lib files and dlls. I am not sure what I should be using.

The zip archives with -dev- in their names contain, surprisingly,
things software developers need. More specifically, they contain the
headers thay you use when compiling, and (import) libraries you link
to (the .lib files for Microsoft's linker, the .dll.a files for the
GNU linker).

Then when you run your application you need the run-time files from
the corresponding zip archives without -dev- in the name.

 > I have all of my paths set in my project so that I can find the
 > appropriate header files. My current problem is trying to link.

Add glib-2.0.lib to the libraries that you link with.

Then, when you run the resulting executable, you need to have the
folder where the GLib DLL is in your PATH. (Or, you need to put your
executable in the same folder where the DLLs are.)

I want to warn you in advance that it is usually a very bad idea, and
only leads to confusion, to start moving or copying files around from
the directory structure they are in when unzipped from the run-time
zip archives. You can unzip ("install") the archive as a whole in any
location (there are no hardcoded paths compiled in), and you can move
the whole directory structure afterwards. But don't move single files
or subfolders.

Especially for Pango and Gtk+ such copying/moving often leads to the
DLLs then not finding necessary other files at run-time. The Pango and
GTK+ DLLs are not usable "freestanding" without run-time support
files. Well, in the newest Win32 builds of Pango, the Pango modules
(the backend and script-specific shaper modules) are now built-in, but
the GTK+ ones definitely aren't.

If you want to trim down the size of a GTK+ installation, it is
possible to simply remove files related to functionality you aren't
interested in, for instance for deployment on customer machines. If
the message catalogs for non-English languages are of no interest to
you, remove the lib\locale tree. In Pango, unless your code explicitly
invokes its functionality, you will not need the pangoft2 DLL.

--tml




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