Need help installing python autopy package on mac os x - complexity with libpng and png.h

I was wondering if anyone could help me figure this out. When I try to install python setup.py (or install pip or easy_install) this will happen

the essence

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 

... a bunch of mistakes ...

 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 is in the / Framework library, which is in the search path for <> includes (I checked cpp -v), but it is there like libpng.framework, and then the headers are in a subdirectory called headers. There are also several versions of libpng in the libpng.framework file. I also run 64bit python. Any ideas on how to proceed?

Thanks Pat

+7
source share
2 answers

The error, you guessed it, because the compiler cannot find the header file png.h

Can you tell me how to enable the framework? Do you use -I and -L?

The correct syntax for enabling a framework with GCC is

gcc -F * dir *

or

gcc -iframework * dir *

Hope this helps

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

-Fdir Add a directory to a directory at the top of the list of directories that will look for header files. These directories alternate with the options specified by the -I options and are scanned from left to right.

 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 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
source

In this particular case, this is because you are missing libpng. (Frame with png.h)

You can install it from http://ethan.tira-thompson.com/Mac_OS_X_Ports.html and then restart autorun, and you should be kind!

0
source

All Articles