At the moment, I have tried countless solutions and nothing works. I am trying to install mysql-python, but this happens with numpy and other packages requiring gcc:
building '_mysql' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64 In file included from _mysql.c:29: /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
To point:
I installed command line tools
Added symlink from / usr / bin / gcc to / usr / bin / gcc-4.2
gcc-4.2 --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.1.0 Thread model: posix
Created a dummy c file, successfully compiled and launched it, so gcc itself is excellent [/ p>
$ cat ac #include <stdio.h> main() { printf("hello\n"); } $ gcc-4.2 ac ac:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main() ^~~~ 1 warning generated. $ ./a.out hello
And for good measure
$ xcode-select -p /Library/Developer/CommandLineTools
What's happening?!
EDIT - Forgot to enable python version
$ python Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
EDIT - Addictive Development. Setting these variables makes some progress:
$ export CFLAGS="-arch i386 -arch x86_64" $ export FFLAGS="-m32 -m64" $ export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" $ export CC=gcc-4.2 $ export CXX="g++ -arch i386 -arch x86_64"
However, it does not work again on
gcc-4.2 -bundle -undefined dynamic_lookup -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -Wall -undefined dynamic_lookup -bundle build/temp.macosx-10.6-intel-2.7/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -o build/lib.macosx-10.6-intel-2.7/_mysql.so -arch x86_64 ld: library not found for -lSystem clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'gcc-4.2' failed with exit status 1
I suspect that this error is related to the teams. Also, why does he use "/Developer/SDKs/MacOSX10.6.sdk"? (sorry noob questions, I'm trying to switch from vim / unix to pycharm / mac, and so far this is not very good :()