views:

506

answers:

2

first of all i am very new to all this. i recently upgraded to Snow Leopard and installed the Xcode + iPhone dev package, 3.1.2. I went on to install the Django framework + MYSQLDB handler. During the build stage, the terminal shows me the gcc exit status 1 error. But I have the Xcode already installed?

where am I going wrong?

Also while trying to fix things up, I installed the Xcode that came with the Snow Leopard DVD. still the same error.

now I think I should remove the Xcode completely and do a fresh install?

Is the ver.3.1.2 specific to 32-bit? please help me out?

here is the complete error:

Amit-Vermas-MacBook:mysql-python-1.2.2 amitverma$ gcc-4.0
i686-apple-darwin10-gcc-4.0.1: no input files
Amit-Vermas-MacBook:mysql-python-1.2.2 amitverma$ python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-i386-2.5/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
cc1: error: unrecognized command line option "-Wno-long-double"
error: command 'gcc' failed with exit status 1
A: 

It normally also shows why a compilation fails. Could you give the text preceding "gcc exited with code 1" or something like that? And perhaps the source file also.

Also look for other threads on this subject, like this one. Good search terms on google or stack overflow are leopard and MySQLdb.

extraneon
+1  A: 

I am not sure if you solved your problem. I got the exact same issue after I upgraded from Mac OS 10.4 to 10.6.

Following some blog posts, on a hunch, I ran setup.py pointing to an older gcc version (gcc-4.0).

CC='/usr/bin/gcc-4.0' python setup.py build

The build encountered few warnings.

running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
running build_ext
building '_mysql' extension
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-i386-2.5/_mysql.o -g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
In file included from _mysql.c:36:
/usr/local/mysql/include/my_config.h:1050:1: warning: "HAVE_WCSCOLL" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
                 from pymemcompat.h:10,
                 from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:724:1: warning: this is the location of the previous definition
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.3-i386-2.5/_mysql.so
ld: warning: in build/temp.macosx-10.3-i386-2.5/_mysql.o, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture

Ran the same command again.

Everything works now magically. The install also went through. The module works as expected.

djangopowered