繁体   English   中英

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

[英]Need help installing python package autopy on mac os x - difficulty with libpng and png.h

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

要点是

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

......一堆错误......

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位于Library / Frameworks中,它位于<> includes(我用cpp -v检查)的搜索路径上,但它在那里作为libpng.framework,然后标题位于名为headers的子目录中。 libpng.framework文件中还有几个版本的libpng。 我也在运行64位python。 任何想法如何进行?

谢谢,帕特

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

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

使用GCC包含框架的正确语法是

gcc -F * dir *

要么

gcc -iframework * dir *

希望这可以帮助

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

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

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.

在这种特殊情况下,这是因为你错过了libpng。 (带有png.h的框架)

您可以从http://ethan.tira-thompson.com/Mac_OS_X_Ports.html安装它然后重新运行autopy安装,你应该好好去!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM