7

誰かが私がこれを理解するのを手伝ってくれるかどうか疑問に思っていました. python setup.py ビルド (または 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 にあります。これは < > インクルードの検索パスにあります (cpp -v で確認しました) が、libpng.framework としてそこにあり、ヘッダーは headers というサブディレクトリにあります。libpng.framework ファイルには、いくつかのバージョンの libpng もあります。私は64ビットのpythonも実行しています。続行する方法はありますか?

ありがとう、パット

4

2 に答える 2

2

ご想像のとおり、エラーはコンパイラがヘッダーファイル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.
于 2012-04-12T14:31:46.393 に答える
0

この特定のケースでは、libpng が見つからないことが原因です。(png.h を含むフレームワーク)

http://ethan.tira-thompson.com/Mac_OS_X_Ports.htmlからインストールしてから、autopy インストールを再実行すれば、準備完了です。

于 2012-06-11T20:07:52.640 に答える