[cairo] Errors building Cairo and Pixman under Cygwin

Tor Lillqvist tml at iki.fi
Sun Apr 12 00:04:02 PDT 2009


> I have a requirement to build an application that uses Cairo on Windows.
> All I need is a Cairo DLL or similar that allows me to do this.

Well, have you tried one of the pre-built cairo DLLs that are
available then? The one I build is available from
http://www.gtk.org/download-windows.html , more specifically the
current one is in
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.6-1_win32.zip
.

> It now seems that PkgConfig relies on elements of Glib
> and Glib in turn relies on PkgConfig.  I am thoroughly confused.

The GLib dependency on pkg-config is only at build-time, if using the
configure script. The README.win32 in pkg-config sources says:

    On Unix, pkg-config is built using its own copy of GLib 1.2.8. On
    Windows, we use the normal GLib available for Windows (2.x). Yes,
    this does introduce a kind of circular dependency. But, that can
    be worked around. The circular dependency only appears if one uses
    the configure mechanism to build GLib. GLib's configure script
    checks for pkg-config. pkg-config depends on GLib. Thus, starting
    from scratch, with no GLib and no pkg-config, using configure,
    there would indeed be a Catch-22 situation. However, GLib can be
    built just fine using the manually written makefiles for mingw or
    MSVC. And if somebody does want to build GLib on Win32 using
    configure, she can first install a prebuilt pkg-config.

(Actually that is a bit outdated. There are no manually written
makefiles for MinGW in GLib any more. Maintaining them was just too
much work.)

> Could someone please describe the exact steps needed to get a DLL for Cairo
> on Windows mentioning all of the required dependencies and build
> instructions?  I am quite prepared to walk the walk but I do need a hand in
> establishing the correct path.

There are several different ways to build things like this. I use the
"traditional", Unix-like one, that uses the GNU toolchain, i.e.
"MinGW". Vladimir mentioned another one. The first thing one needs to
do is to have a good understanding of the corresponding steps on Unix
(Linux typically). Once you understand the steps involved and what
they do, basically what you do is use the same mechanism on Windows.
This of course requires that the same tools are installed. This is
where most of the problems are. Unfortunately, many of the involved
tools can have somewhat randomly appearing behaviour on Windows, and
it is impossible, at least for me, now, to give exact instructions.
There are always some new gotchas.

--tml


More information about the cairo mailing list