建筑物开罗的Windows使用MinGW(连接问题的libpng) [英] Building Cairo for Windows with MinGW (Problems linking libpng)
问题描述
我试图建立在Windows上使用MinGW的(和MSYS)开罗。我下面的编译GTK + 2.16.4用于Windows ,但我使用的是最新版本只要有可能,例如:
- 的zlib-1.2.3
- 的libpng-1.2.42
- pixman-0.17.4
- 开罗-1.8.8
这工作pretty很好,直到当我尝试构建实际的开罗。在配置成功,但要在开罗似乎有链接到我的libpng构建问题。过了一会儿,我得到的错误一长串像这样的:
的.libs /开罗png.o:在功能`png_simple_error_callback:
/home/user/cairo-1.8.8/src/cairo-png.c:95:未定义参考`png_get_error_ptr
的.libs /开罗png.o:在功能`png_simple_warning_callback:
/home/user/cairo-1.8.8/src/cairo-png.c:112:未定义参考`png_get_error_ptr...的.libs /开罗png.o:在功能`stream_read_func:
/home/user/cairo-1.8.8/src/cairo-png.c:686:未定义参考`png_error
collect2:劳工处返回1退出状态
使[3]:*** [libcairo.la]错误1
使[3]:离开目录`/home/user/cairo-1.8.8/src
使[2]:*** [全部]错误2
使[2]:离开目录`/home/user/cairo-1.8.8/src
使[1]:*** [所有递归]错误1
使[1]:离开目录`/home/user/cairo-1.8.8
使:*** [全部]错误2
块引用>我一直在使用的libpng(1.2.40较旧版本的尝试,该版本由的GTK +项目),具有相同的结果。当我运行pkg配置-cflags -libs的libpng我得到-IC:/ MinGW的/有/填实:libpng12 -LC:/ MinGW的/ lib目录-lpng12,这似乎是正确的。我敢肯定,我在做一些愚蠢的错误,但我不能告诉你它是什么。
解决方案显然,这是一个已知的问题。我不知道如何成功地错过它,因为它是在的博客,我是下(我认为这是安全的假设,这也适用于Windows 7,因为我试过的第三项建议,并将其固定我的问题):
现在,让我们开始安装MinGW的。需要注意的是MinGW的没有在Windows Vista流畅运行,因为怪异的文件系统的限制。解决方法是
- 要在FAT文件系统上安装的MinGW,
- 要在安全模式下工作,或
- 要使用MinGW的便携式据说这是运作良好。
块引用>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.
解决方案Apparently this is a known issue. I don't know how managed to miss it, given that it is even mentioned in the blog that I was following (I think it's safe to assume that this also applies to Windows 7, given that I tried the third suggestion and it fixed my problem):
Now, let's install MinGW. Note that MinGW doesn't run smoothly on Windows Vista because of weird filesystem restrictions. The workaround is
- to install MinGW on FAT filesystem,
- to work in the safe mode, or
- to use MinGW Portable which is said to be working well.
这篇关于建筑物开罗的Windows使用MinGW(连接问题的libpng)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!