gtk2.x 静态编译时 需要注意的是 cairo
cairo 1.14.x 使用了 mutex , 用动态方式时 DllMain 中调用了 CAIRO_MUTEX_INITIALIZE ()
在静态编译时不能自动初始化 mutex , 所以 gtk 静态程序出现错误.
需要在 gtk_init() 中加载 CAIRO_MUTEX_INITIALIZE ();
在 gtk_quit_destroy() 中调用 CAIRO_MUTEX_FINALIZE ();
-------------------------------------------------------------------------------------------------------
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 -lpthread -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-font cairo (version 1.14.6 [release]) will be compiled with: The following surface backends:
Image: yes (always builtin)
Recording: yes (always builtin)
Observer: yes (always builtin)
Mime: yes (always builtin)
Tee: no (disabled, use --enable-tee to enable)
XML: no (disabled, use --enable-xml to enable)
Skia: no (disabled, use --enable-skia to enable)
Xlib: no (requires X development libraries)
Xlib Xrender: no (requires --enable-xlib)
Qt: no (disabled, 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.org)
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 enable)
BeOS: no (disabled, use --enable-beos to enable)
DirectFB: no (disabled, use --enable-directfb to enable)
OpenVG: no (disabled, use --enable-vg to enable)
DRM: no (disabled, use --enable-drm to enable)
Cogl: 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 following 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-xcb 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: yes And the following internal features:
pthread: yes
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 (fdwReason) {
case DLL_PROCESS_ATTACH:
CAIRO_MUTEX_INITIALIZE ();
break; case DLL_PROCESS_DETACH:
CAIRO_MUTEX_FINALIZE ();
break;
} return TRUE;
} */
----------------------------------------------------------------------------------
__declspec(dllexport) fix to --> __attribute__((visibility ("default")))
define xxx __declspec(dllimport) fix to --> define xxx extern
__attribute__((visibility ("hidden"))) fix to --> __attribute__((visibility ("default")))
delete all DllMain function src\cairoint.h(54):#define cairo_public __declspec(dllexport)
#define cairo_public __declspec(dllexport) -> __attribute__((visibility ("default"))) src\cairo.h(55):# define cairo_public __declspec(dllimport)
#define cairo_public __declspec(dllimport) -> extern src\cairo-compiler-private.h(120):#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 ();
}
----------------------------------------------------------------------------------
链接:http://pan.baidu.com/s/1hrXKrBY 密码:fxh0

_cairo-1.14.6-staticLib.7z

cairo-1.14.6 static compiler msys mingw32的更多相关文章

  1. GNU Wget 1.19.1 static built on mingw32

    http://pan.baidu.com/s/1sluFAVj #wget --version GNU Wget 1.19.1 built on mingw32. -cares +digest -gp ...

  2. gtk+-3.21.4 static build step in windows XP

    In recent days the weather is very hot Unable to sleep properly Under the state of daze research gtk ...

  3. 开源项目:windows下使用MinGW+msys编译ffmpeg

    本文参考了网络上的不少文章,但由于版本环境的问题参考文章并不能直接指导编译,本文吸收多方经验,并在自己多次编译实验的基础上写成,欢迎转载,请注名出处.    FFmpeg是在Linux平台下开发的,但 ...

  4. windows 下使用 MinGW + msys 编译 ffmpeg

    本文参考了网络上的不少文章,但由于版本环境的问题参考文章并不能直接指导编译,本文吸收多方经验,并在自己多次编译实验的基础上写成,欢迎转载,请注名出处.    FFmpeg是在Linux平台下开发的,但 ...

  5. Thrift compiler代码生成类解析

    代码生成类解析: Thrift--facebook RPC框架,介绍就不说了,百度,google一大把,使用也不介绍,直接上结构和分析吧. Hello.thrift文件内容如下: namespace ...

  6. [C#6] 1-using static

    0. 目录 C#6 新增特性目录 1. 老版本的代码 1 using System; 2 3 namespace csharp6 4 { 5 internal class Program 6 { 7 ...

  7. static详解

    static关键字用来修饰属性.方法,称这些属性.方法为静态属性.静态方法. static关键字声明一个属性或方法是和类相关的,而不是和类的某个特定的实例相关,因此,这类属性或方法也称为“类属性”或“ ...

  8. PHP面向对象之旅:static变量与方法

    static关键字声明一个属性或方法是和类相关的,而不是和类的某个特定的实例相关,因此,这类属性或方法也称为“类属性”或“类方法”. 如果访问控制权限允许,可不必创建该类对象而直接使用类名加两个冒号“ ...

  9. 解决libc.so.6: version `GLIBC_2.14' not found问题, 升级glibc,glibc-2.15

    0.以下在系统CentOS 6.3 x86_64上操作 1.试图运行程序,提示"libc.so.6: version `GLIBC_2.14' not found",原因是系统的g ...

随机推荐

  1. CFgym Board Queries (旋转、翻转简化)

    http://codeforces.com/gym/100497 codeforces 2014-2015 CT S02E04: Codeforces Trainings Season 2 Episo ...

  2. protobuf

    1.下载地址:https://code.google.com/p/protobuf/downloads/list 安装 ./configure && make && m ...

  3. php 短路逻辑运算符

    短路与 && 短路或 || or.||.and.&& 都是短路运算符 &&(and)短路与运算符检查第一个表达式是否返回“flase”,如果是“fals ...

  4. iOS9 Universal Link实现

    先来贴几个比较全面的帖子,看完就差不多了. 1   iOS 9 通用链接(Universal Links) 帖子注意项非常重要,仔细阅读. 自己补充几点: 1 服务器上配置的json文件apple-a ...

  5. 升级xcode7.0 第三方库不能用的解决方法(bitcode是什么鬼?)

    升级完xcode,真机运行发现报错,第三方库错误,微信SDK,高德SDK都报错,如下: ‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib ...

  6. putchar和puts

    #include<stdio.h> int main() { char a = 'h'; char b[] = "hello"; putchar(a); //putch ...

  7. PHP读取word文档

    在PHP中读取和写入WORD文档的代码 <? php // 建立一个指向新COM组件的索引 $word = new COM(”word.application”) or die(”Can't s ...

  8. SDK 移动应用开发系统

    AppCan SDK 是一套跨平台移动应用开发系统,基于业内领先的Hybrid App 开发引擎,采用HTML5 标准作为开发语言,支持一次开发多平台适配.AppCan SDK 提供应用向导和界面向导 ...

  9. unity销毁层级物体及 NGUI 深度理解总结

    http://www.2cto.com/kf/201311/258811.html 1.想找到层级面板中某个物体,并销毁,利用下面的代码:    GameObject  obj = GameObjec ...

  10. hiho #1326 : 有序01字符串

    #1326 : 有序01字符串 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 对于一个01字符串,你每次可以将一个0修改成1,或者将一个1修改成0.那么,你最少需要修改 ...