gtk2.x Static compilation should be noted that the Cairo Cairo 1.14.x uses a mutex, dynamic mode when the DllMain call Cairo_mutex_initialize () in the static compilation can not automatically initialize the mutex, so G There was an error in the TK static program. You need to load cairo_mutex_initialize () in Gtk_init (); Call Cairo_mutex_finalize () in Gtk_quit_destroy ();------------- ------------------------------------------------------------------------------------------build Static Libs-------------------------------------------------------------------------------------------------------Export libffi_cflags= "-i/usr/local/lib/libffi-3.2.1/include" Export libffi_libs= "-lffi" Export zlib_cflags=-i/usr/local/ Include Export Zlib_libs=-lz export cflags= "-i/usr/local/include-o2-wall-march=i686-mms-bitfields-mthreads-static" Export cppflags= "-i/usr/local/include" Export ldflags= "-l/usr/local/lib" Export libs= '-lpsapi-lws2_32-lmswsock-lp Thread-lffi-lole32-lwinmm-lshlwapi-lintl-liconv-lgdiplus-luuid-lharfbuzz-lharfbuzz-icu-lexpat-lgdi32-lmsimg32 -lz ' #-lsupc++./configure--prefix=/usr/local--enable-static--disable-shared--disable-gtk-doc--enable-win32--enable-win32-fontcairo (version 1.14.6 [release]) would be Compiled with:the following surface backends:Image:yes (always builtin) Recording:yes (always builtin) O Bserver:yes (always builtin) Mime:yes (all builtin) Tee:no (disabled, use--enable-tee to Enable) Xml:no (disabled, use--enable-xml to enable) Skia:no (disabled, use--enable-skia to Enabl e) Xlib:no (requires X development libraries) Xlib Xrender:no (requires--enable-xlib) Qt:no (d isabled, use--ENABLE-QT to enable) Quartz:no (requires Coregraphics framework) Quartz-image:no (disabled, use --enable-quartz-image to enable) Xcb:no (requires XCB >= 1.6 xcb-render >= 1.6 HTTP://XCB.FREEDESKTOP.O RG) Win32:yes Os2:no (disabled, use--ENABLE-OS2 to enable) Cairoscript:yes Postscript:yes Pdf:yes SVG: Yes Opengl:no (disabled, use--ENABLE-GL to enable) OpenGL ES 2.0:no (disabled, use--ENABLE-GLESV2 to Ena BLE) beos:no (disabled, use--enable-beos to enable) Directfb:no (disabled, use--ENABLE-DIRECTFB to Ena BLE) openvg:no (disabled, use--ENABLE-VG to enable) Drm:no (disabled, use--ENABLE-DRM to enable) C Ogl:no (disabled, use--ENABLE-COGL to enable) the following font Backends:User:yes (always builtin) Freetype:yes fontconfig:yes win32:yes Quartz:no (requires Coregraphics framework) the follow ing functions:png functions:yes GLX functions:no (not required by any backend) WGL Functions:no (not required By any backend) EGL Functions:no (not required by any backend) X11-XCB Functions:no (disabled, use--ENABLE-XLIB-XC b to enable) Xcb-shm Functions:no (requires--ENABLE-XCB) the following features and Utilities:cairo-trace: No (Requires dynamic Linker and zlib and real pthreads) Cairo-script-interpreter:yesand the following internal features:pthread:y Es gtk-doc:no gcov support:no symbol-lookup:no (requires BFD) test Surfaces:no (disabled, use--enable-test -surfaces to enable) PS Testing:no (requires libspectre) PDF Testing:no (requires Poppler-glib >= 0.17.4) SVG Testing:no (Requires librsvg-2.0 >= 2.35.0) Win32 Printing Testing:no (requires Ghostscript)------------------ ----------------------------------------------------------------src/win32/ CAIRO-WIN32-SYSTEM.C----------------------------------------------------------------------------------/* BOOL WINAPI DllMain (hinstance hinstDLL, DWORD fdwreason, LPVOID lpvreserved); BOOL WINAPI DllMain (hinstance hinstDLL, DWORD fdwreason, LPVOID lpvreserved) {switch (fdwre Ason) {case dll_process_attach:cairo_mutex_initialize (); BreakCase Dll_process_detach:cairo_mutex_finalize (); Break } return TRUE; } */----------------------------------------------------------------------------------__declspec (dllexport) Fix to--__attribute__ ((Visibility ("default")) define XXX __declspec (dllimport) fix to--Defin e xxx extern__attribute__ ((Visibility ("hidden"))) fix to--__attribute__ ((Visibility ("default")) Delete all Dll Main functionsrc\cairoint.h: #define Cairo_public __declspec (dllexport) #define Cairo_public __declspec (dllexport )-__attribute__ ((Visibility ("default")) Src\cairo.h: # define Cairo_public __declspec (dllimport) #define Cairo_public __declspec (dllimport), externsrc\cairo-compiler-private.h (+): #define Cairo_private_no_warn__ ATTRIBUTE__ ((__visibility__ ("hidden"))) #define CAIRO_PRIVATE_NO_WARN__ATTRIBUTE__ ((__visibility__ ("hidden"))- > ("Default") Util\cairo-script\cairo-script-private.h (165): #define Csi_PRIVATE_NO_WARN__ATTRIBUTE__ ((__visibility__ ("hidden"))) #define CSI_PRIVATE_NO_WARN__ATTRIBUTE__ ((__visibility_ _ ("hidden")) ("Default")--------------------------------------------------------------------------------- -src/cairo.h----------------------------------------------------------------------------------cairo_public Void Cairo_mutex_init (); cairo_public void Cairo_mutex_finalize ();---------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -src/cairo.c----------------------------------------------------------------------------------void Cairo_mutex_ Init () {cairo_mutex_initialize ();} void Cairo_mutex_finalize () {cairo_mutex_finalize ();} ----------------------------------------------------------------------------------Links: http://pan.baidu.com/s/ 1hrXKrBY Password: fxh0
_cairo-1.14.6-staticlib.7z
cairo-1.14.6 Static compiler Msys MINGW32