首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >需要在mac os x上安装python包autopy的帮助- libpng和png.h的困难

需要在mac os x上安装python包autopy的帮助- libpng和png.h的困难
EN

Stack Overflow用户
提问于 2011-12-06 09:16:42
回答 2查看 1.6K关注 0票数 7

我想知道有没有人能帮我解决这个问题。当我尝试python setup.py构建(或pip install,或easy_install)时,会发生这种情况。

要点是

代码语言:javascript
复制
src/png_io.c:3:17: error: png.h: No such file or directory
src/png_io.c: In function ‘newMMBitmapFromPNG’:
src/png_io.c:34: error: ‘png_struct’ undeclared (first use in this function)
src/png_io.c:34: error: (Each undeclared identifier is reported only once

..。一堆错误...

代码语言:javascript
复制
src/png_io.c:332: error: ‘PNG_TRANSFORM_IDENTITY’ undeclared (first use in this function)
lipo: can't figure out the architecture type of:  /var/folders/kt/d8t29zkx7kd_7c_mr17ntv6m0000gn/T//ccubs4CM.out

error: command 'gcc-4.2' failed with exit status 1

libpng在库/框架中,它在<> includes的搜索路径上(我用cpp -v检查过了),但它在那里是libpng.framework,然后头文件在一个名为headers的子目录中。在libpng.framework文件中还有几个版本的libpng。我也在运行64位的python。有什么想法可以继续吗?

谢谢,帕特

EN

回答 2

Stack Overflow用户

发布于 2012-04-12 22:31:46

正如您所猜到的,错误是因为编译器找不到头文件png.h

你能告诉我这个框架是如何被包含进来的吗?你在使用-I和-L吗?

在GCC中包含框架的正确语法是

gcc -F*dir*

gcc -iframework*dir*

希望这能有所帮助

来自http://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html

-Fdir将框架目录dir添加到要搜索头文件的目录列表的头部。这些目录与-I选项指定的目录交错,并按从左到右的顺序进行扫描。

代码语言:javascript
复制
A framework directory is a directory with frameworks in it. A framework is a directory with a Headers and/or PrivateHeaders directory contained directly in it that ends in .framework. The name of a framework is the name of this directory excluding the .framework. Headers associated with the framework are found in one of those two directories, with Headers being searched first. A subframework is a framework directory that is in a framework's Frameworks directory. Includes of subframework headers can only appear in a header of a framework that contains the subframework, or in a sibling subframework header. Two subframeworks are siblings if they occur in the same framework. A subframework should not have the same name as a framework, a warning will be issued if this is violated. Currently a subframework cannot have subframeworks, in the future, the mechanism may be extended to support this. The standard frameworks can be found in /System/Library/Frameworks and /Library/Frameworks. An example include looks like #include <Framework/header.h>, where Framework denotes the name of the framework and header.h is found in the PrivateHeaders or Headers directory.
票数 2
EN

Stack Overflow用户

发布于 2012-06-12 04:07:53

在本例中,这是因为您缺少libpng。(带有png.h的框架)

你可以从http://ethan.tira-thompson.com/Mac_OS_X_Ports.html安装它,然后重新运行自动安装,你就可以开始了!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8394157

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档