Compiling Cairo with Qt support for MinGW
I have been trying to build cairo as a static library with support for cairo's experimental Qt features (I cannot use the official GTK binary releases). My Qt installation has no pkg-config within Mingw so I decided it would be easiest to cross-compile cairo on linux.
Using this cross compiler http://mingw-cross-env.nongnu.org/ and the commands:
./configure --prefix=/tmp/cairo --host=i686-pc-mingw32 --enable-qt
make
make install
I received an error generated by -Werror about implicit declaration of a function, however after modifying the makefile cairo builds correctly.
I copy the contents of /tmp/cairo to my MinGW installation under windows however when I try to开发者_高级运维 compile a simple test program I receive the error when linking:
undefined reference to `cairo_qt_surface_create'
on the code:
QPainter p(viewport());
cairo_surface_t *surface = cairo_qt_surface_create(&p);
cairo_t *cr = cairo_create(surface);
I am using qmake for this test and included the following as extra library's:
-lcairo -lcairo-gobject -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0
精彩评论