2011-12-06 6 views
7

Mi stavo chiedendo se qualcuno potesse aiutarmi a capirlo. Quando provo a python setup.py build (o PIP installare, o easy_install), questo accadeHo bisogno di aiuto nell'installazione di python pacchetto autopy su mac os x - difficoltà con libpng e png.h

il succo è

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 

... mucchio di errori ...

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 è in Library/Frameworks, che si trova nel percorso di ricerca per <> includes (ho controllato con cpp -v), ma è lì dentro come libpng.framework, e quindi le intestazioni sono in una sottodirectory chiamata headers. Esistono anche diverse versioni di libpng nel file libpng.framework. Sto anche eseguendo python a 64 bit. Qualche idea su come procedere?

Grazie, Pat

risposta

2

L'errore è, come avete indovinato, perché il compilatore non riesce a trovare il file di intestazione png.h

mi puoi dire come il quadro è incluso? Stai usando -I e -L?

La sintassi corretta per l'inclusione di un quadro con GCC è

gcc -F * dir *

o

gcc -iframework * dir *

Spero che questo aiuti

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

-F dir Aggiungi la dir della directory framework alla testa dell'elenco di directory in cui cercare i file di intestazione. Queste directory sono intercalate con quelle specificate dalle opzioni -I e sono scansionate in un ordine da sinistra a destra.

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.