2011-12-06 13 views
7

Me preguntaba si alguien podría ayudarme a resolver esto. Cuando trato de instalar python setup.py (o PIP instalar, o easy_install), esto ocurreNecesita ayuda para instalar el paquete python autopy en mac os x - dificultad con libpng y png.h

lo esencial es

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 

... montón de errores ...

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 está en Library/Frameworks, que está en la ruta de búsqueda <> includes (he comprobado con cpp -v), pero está allí como libpng.framework, y luego los encabezados están en un subdirectorio llamado encabezados. También hay varias versiones de libpng en el archivo libpng.framework. También estoy ejecutando Python de 64 bits. ¿Alguna idea de cómo proceder?

Gracias, Pat

Respuesta

2

El error es, como lo has adivinado, porque el compilador no puede encontrar el archivo de cabecera png.h

¿Me puede decir cómo se está incluyendo el marco? ¿Estás usando -I y -L?

La sintaxis correcta para la inclusión de un marco con GCC es

gcc -F * dir *

o

-iframework gcc * dir *

Esperanza esto ayuda

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

-F dir Agregue el directorio directorio dir al encabezado de la lista de directorios para buscar archivos de encabezado. Estos directorios se entrelazan con los especificados por las opciones -I y se escanean en orden de izquierda a derecha.

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. 
Cuestiones relacionadas