Menu

OS X Install problem

Anonymous
2008-07-15
2012-09-19
  • Anonymous

    Anonymous - 2008-07-15

    I am getting the following error message :

    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) -Dversion=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 -Os -arch x86_64 -fno-common
    In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,
    from pymemcompat.h:10,
    from _mysql.c:29:
    /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:761:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
    In file included from _mysql.c:35:
    /usr/local/mysql/include/my_config.h:1032:1: warning: "SIZEOF_LONG" 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:814:1: warning: this is the location of the previous definition
    error: command 'gcc' failed with exit status 1

    I installed the developer tools after installing mySQL, not sure if this is the cause of the problem.

    Any help would be much appreciated.

     
    • Pete

      Pete - 2008-11-29

      When compiling 1.2.2c1 for OS X 10.5 (latest Developer Tools), and building against mysql 5.1.3 osx10.5, I got a similar error:

      running install
      running bdist_egg
      running egg_info
      writing MySQL_Python.egg-info/PKG-INFO
      writing top-level names to MySQL_Python.egg-info/top_level.txt
      writing dependency_links to MySQL_Python.egg-info/dependency_links.txt
      reading manifest file 'MySQL_Python.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file 'MySQL_Python.egg-info/SOURCES.txt'
      installing library code to build/bdist.macosx-10.5-i386/egg
      running install_lib
      running build_py
      copying MySQLdb/release.py -> build/lib.macosx-10.5-i386-2.5/MySQLdb
      running build_ext
      building '_mysql' extension
      gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -pipe -Dversion_info=(1,2,2,'gamma',1) -Dversion=1.2.2c1 -I/usr/local/mysql-5.1.30-osx10.5-x86/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.5-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 /usr/local/mysql-5.1.30-osx10.5-x86/include/mysql.h:47,
      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: command 'gcc' failed with exit status 1

      The problem was not in mysql.h:47 but in _mysql.c:37-40
      35: #include "my_config.h"
      36: #endif
      37: #ifndef uint
      38: #define uint unsigned int
      39: #endif
      40: #include "mysql.h"
      41: #include "mysqld_error.h"
      42: #include "errmsg.h"

      The problem here came up because sys/types.h does not check the typedef for uint. The solution was to move the define statement below the include statement for "msql.h":

      include "mysql.h"

      include "mysqld_error.h"

      include "errmsg.h"

      ifndef uint

      define uint unsigned int

      endif

      and it built fine. This is not the right way to go about it -- if uint is not defined in sys/types.h gcc will error out in mysql.h. The correct fix should be to include sys/types.h first, then conditionally define uint and finally include "mysql.h":

      include <sys/types.h>

      ifndef uint

      define uint unsigned int

      endif

      include "mysql.h"

      include "mysqld_error.h"

      include "errmsg.h"

      Which also works fine.

      Cheers,
      Pete

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.