Re: Native Windows Gtk+ from Cygwin

Daryl Lee writes:
I'm trying to use Cygwin to build a native Windows app using Gtk+.

First, the symptoms.  When I run the executable froma DOS prompt, I get
an error alert: "This application as failed to start because
cygglib-2.0-0.dll was not found."

Well, if the application executable is looking for cygglib-2.0-0.dll,
then it most probably isn't a native Win32 application. That the DLL's
name begins with "cyg" is a sure sign that the executable has been
linked to a Cygwin version of GLib. (If the executable still itself is
a native Win32 one, you have a very confsed beast on your hands that
most probably will not run correctly at all, even if you made it find
the DLL by setting PATH.) You presumably have the Cygwin versions of
GTK+ (and Pango, atk, GLib) installed? Unless you really intend to
also develop GTK+ software for Cygwin, I advice you uninstal them
(using the Cygwin setup.exe) to avoid confusion... (Ditto for other
Cygwin development packages.)

Output of `pkg-config --cflags --libs gtk+-2.0`:
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include

etc. These are all for a Cygwin build of GTK+ etc. Native Win32 GTK+
shouldn't be installed inside the Cygwin tree (in /usr/include and
/usr/lib), as that is only confusing.

You should, as a minmum, point pkg-config to the .pc files for the
native Win32 versions of GTK+ etc (set PKG_CONFIG_PATH). But actually,
the Cygwin build of pkg-config probably won't do the prefix
replacement magic on the pathnames in the .pc files, so it will output
incorrect -I and -L flags. It's easiest if you download the native
Win32 pkg-config from, and install
(unzip) it in the same prefix as where you installed the native Win32
GTK+ etc developer (and run-time, presumably) packages.

As always, I will appreciate any help, other than an unreasoned
recommendation to move over to MingW.  (Not that I dislike MingW; I
just would have to install pkg-config and who knows what else.)

Installing a native Win32 pkg-config is what you will need to do. Or
just write the -I and -L flags manually in your Makefile...


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