#239 easy_install compile error in OSX 10.5 PPC

MySQLdb-1.2
open
nobody
MySQLdb (285)
5
2012-09-19
2007-11-12
Xin
No

When make "sudo easy_install MySQL-python", gcc for macosx 10.5 PPC throw an error of duplicate declaration.

I solved this error commenting line 92 of "/usr/include/sys/types.h"

$ sudo easy_install MySQL-python
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python
Reading http://sourceforge.net/projects/mysql-python/
Best match: MySQL-python 1.2.2
Downloading http://osdn.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
Processing MySQL-python-1.2.2.tar.gz
Running MySQL-python-1.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mvd_5X/MySQL-python-1.2.2/egg-dist-tmp-z53AT8
In file included from /usr/local/mysql/include/mysql.h:43,
                 from _mysql.c:40:
/usr/include/sys/types.h:92: error: duplicate ‘unsigned’
/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers
error: Setup script exited with error: command 'gcc' failed with exit status 1
Line 92:
//typedef       unsigned int            uint;           /* Sys V compat */

Discussion

  • Xin
    Xin
    2007-11-12

    Logged In: YES
    user_id=1416312
    Originator: YES

    Import error after coorectly compiled.

    After compiled editing line 92 in file "/usr/include/sys/types.h", when I import raise ImportError:
    The error is caused because path of "/usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib" is not correct.
    The correct directory is "/usr/local/mysql/lib/libmysqlclient_r.15.dylib".
    I solved this error creating a symbolic link to same directory.
    cd /usr/local/mysql/lib/
    sudo ln -s . mysql

    Now work succefull

    import MySQLdb
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "build/bdist.macosx-10.5-ppc/egg/MySQLdb/init.py", line 19, in <module>
    File "build/bdist.macosx-10.5-ppc/egg/_mysql.py", line 7, in <module>
    File "build/bdist.macosx-10.5-ppc/egg/_mysql.py", line 6, in bootstrap
    ImportError: dlopen(/Users/Xin/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-ppc.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
    Referenced from: /Users/Xin/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-ppc.egg-tmp/_mysql.so
    Reason: image not found

     
  • Jodok Batlogg
    Jodok Batlogg
    2007-11-16

    Logged In: YES
    user_id=754964
    Originator: NO

    that's a duplicate bug of #1808476