Menu

Installation with cygwin

Help
2002-03-04
2012-09-19
  • Tony Goodwin

    Tony Goodwin - 2002-03-04

    Anyone get MySql working with python under cygwin
    I have added following entry to setup.py
    without success - I get linkage errors.

    Any help appreciated

    >> script changes
    elif sys.platform == "cygwin":
        include_dirs = [r'c:\mysql\include']
        library_dirs = [r'c:\mysql\lib\opt']
        libraries = [ mysqlclient, 'zlib', 'libmySQL']
        runtime_library_dirs = []
        extra_objects = [r'c:\mysql\lib\opt\mysqlclient.lib']

    >> linkage errors
    build/temp.cygwin-1.3.9-i686-2.2/_mysql.o: In function `mysql_escape_string':
    /usr/local/lib/python2.2/site-packages/MySQL-python-0.9.1/_mysql.c:405: undefine
    d reference to `mysql_real_escape_string'
    build/temp.cygwin-1.3.9-i686-2.2/_mysql.o: In function `mysql_string_literal':
    /usr/local/lib/python2.2/site-packages/MySQL-python-0.9.1/_mysql.c:447: undefine
    d reference to `mysql_real_escape_string'
    build/temp.cygwin-1.3.9-i686-2.2/_mysql.o: In function `mysql_ConnectionObject_c
    hange_user':
    /usr/local/lib/python2.2/site-packages/MySQL-python-0.9.1/_mysql.c:882: undefine
    d reference to `mysql_change_user'
    build/temp.cygwin-1.3.9-i686-2.2/_mysql.o: In function `mysql_ConnectionObject_c
    haracter_set_name':
    /usr/local/lib/python2.2/site-packages/MySQL-python-0.9.1/_mysql.c:899: undefine
    d reference to `mysql_character_set_name'
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

     
    • Andy Dustman

      Andy Dustman - 2002-03-04

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/\*checkout*/mysql-python/MySQLdb/setup.py?rev=1.21&content-type=text/plain

      The above version has cygwin support, it will be in 0.9.2. It should work with previous 0.9.x versions.

       
      • Tony Goodwin

        Tony Goodwin - 2002-03-05

        Andy,
        It didn't work, I had to change to following  to pick up mapped c drive (I dont know if that is standard or not) and the list of libraries required in lib/opt as opposed to lib.

        I am using MySQL 3.23.37 (current stable is 3.23.49) and I get a lot of header problems with the mysql_com.h (Vio structure I think) if I try to compile.

        I took out the MS_WIN32 and got it to compile by ifdef'ing out the definitions surrounded by WIN32 (I used NULL versions).

        I also had to change my version id to 32200 as I did not appear to have the real_escape_string function in my libs - according to source, it was delivered in 32321

        >>>
        elif sys.platform == "cygwin":
            include_dirs = ['/cygdrive/c/mysql/include']
            library_dirs =['/cygdrive/c/mysql/lib','/cygdrive/c/mysql/lib/opt']
           extra_compile_args = ['-DMS_WIN32']
            libraries = ['libmySQL', 'zlib', mysqlclient ]
        >>>

         
        • Tony Goodwin

          Tony Goodwin - 2002-03-05

          Whoops,
          forgot to add. This does then compile and install, but I get a Win err 126 when I try to import?

          Any ideas

          Tony

           
        • Andy Dustman

          Andy Dustman - 2002-03-05

          I really don't know anything about cygwin. What's in there now was contributed.

           

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.