I m trying to build cairo on Windows using MinGW (and MSYS). I am following the instrucions on Compiling GTK+ 2.16.4 for Windows, except that I m using the latest versions whenever possible, i.e:
- zlib-1.2.3
- libpng-1.2.42
- pixman-0.17.4
- cairo-1.8.8
This works pretty well up until when I try to build the actual cairo. The configuration succeeds, but during make cairo seems to have problems linking to my build of libpng. After a little while I get a long list of errors such as this:
.libs/cairo-png.o: In function `png_simple_error_callback : /home/user/cairo-1.8.8/src/cairo-png.c:95: undefined reference to `png_get_error_ptr .libs/cairo-png.o: In function `png_simple_warning_callback : /home/user/cairo-1.8.8/src/cairo-png.c:112: undefined reference to `png_get_error_ptr ... .libs/cairo-png.o: In function `stream_read_func : /home/user/cairo-1.8.8/src/cairo-png.c:686: undefined reference to `png_error collect2: ld returned 1 exit status make[3]: *** [libcairo.la] Error 1 make[3]: Leaving directory `/home/user/cairo-1.8.8/src make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/user/cairo-1.8.8/src make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/cairo-1.8.8 make: *** [all] Error 2
I have tried using an older version of libpng (1.2.40, the version being distributed by The GTK+ Project), with the same result. When I run "pkg-config -cflags -libs libpng" I get "-IC:/MinGW/include/libpng12 -LC:/MinGW/lib -lpng12", which seems correct. I m sure I m making some stupid mistake, but I cannot tell what it is.