Menu

Moved from open discussion

Help
2007-01-08
2012-09-19
  • Jared DeMott

    Jared DeMott - 2007-01-08

    Andy asked me to move my recent questions from open to here. Consider it done.

    Does anyone have a debug version (all you have to do is add /Zi to compile and /DEBUG to link) of mysqldb for python 2.4 they could email me? (demottja@msu.edu)

    I've been trying to track down an critical bug in mysqldb, but I seem to be unable to build a debug version that functions properly. I can build one (I have vs2003), but when it's imported into my code python always crashes on:
    if (PyDict_SetItemString(dict, "version_info", PyRun_String( QUOTE(version_info),Py_eval_input,dict,dict) ))
    goto error;

    When I build this is what I see:
    c:\Python24\python.exe setup.py install
    c:\Python24\lib\distutils\extension.py:133: UserWarning: Unknown Extension optio
    ns: 'mysql_root'
    warnings.warn(msg)
    running install
    running build
    running build_py
    copying MySQLdb\release.py -> build\lib.win32-2.4\MySQLdb
    running build_ext
    building '_mysql' extension
    C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox
    /MD /W3 /GX /DNDEBUG -IC:\Progra~1\MySQL\MySQLs~1.0\include -Ic:\Python24\inclu
    de -Ic:\Python24\PC /Tc_mysql.c /Fobuild\temp.win32-2.4\Release_mysql.obj /Zi
    _mysql.c
    C:\Program Files\MySQL\MySQL Server 5.0\include\config-win.h(178) : warning C400
    5: 'SIZEOF_OFF_T' : macro redefinition
    c:\Python24\include\pyconfig.h(257) : see previous definition of 'SIZEOF
    _OFF_T'
    C:\Program Files\MySQL\MySQL Server 5.0\include\config-win.h(328) : warning C400
    5: 'HAVE_STDDEF_H' : macro redefinition
    c:\Python24\include\pyconfig.h(501) : see previous definition of 'HAVE_S
    TDDEF_H'
    C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL /nologo
    /INCREMENTAL:NO /LIBPATH:C:\Progra~1\MySQL\MySQLs~1.0\lib\opt /LIBPATH:c:\Pytho
    n24\libs /LIBPATH:c:\Python24\PCBuild mysqlclient.lib zlib.lib wsock32.lib advap
    i32.lib /EXPORT:init_mysql build\temp.win32-2.4\Release_mysql.obj /OUT:build\li
    b.win32-2.4_mysql.pyd /IMPLIB:build\temp.win32-2.4\Release_mysql.lib /DEBUG /N
    ODEFAULTLIB:msvcrt
    Creating library build\temp.win32-2.4\Release_mysql.lib and object build\tem
    p.win32-2.4\Release_mysql.exp
    _mysql.obj : warning LNK4217: locally defined symbol _strncpy imported in functi
    on mysql_row_to_dict
    _mysql.obj : warning LNK4217: locally defined symbol _strncat imported in functi
    on
    mysql_row_to_dict
    _mysql.obj : warning LNK4217: locally defined symbol _sprintf imported in functi
    on __mysql_ConnectionObject_repr
    running install_lib
    copying build\lib.win32-2.4\MySQLdb\release.py -> c:\Python24\Lib\site-packages\ MySQLdb
    copying build\lib.win32-2.4_mysql.pdb -> c:\Python24\Lib\site-packages
    copying build\lib.win32-2.4_mysql.pyd -> c:\Python24\Lib\site-packages
    byte-compiling c:\Python24\Lib\site-packages\MySQLdb\release.py to release.pyc

    Does anyone see any obvious problems there?

     
    • Jared DeMott

      Jared DeMott - 2007-01-08

      ahah!

      Adding this /Dversion_info=(1,2,2,'beta',2) /Dversion=1.2.2b2 to my compile line saves the day. I can now compile a working debug version.

      So just for completeness:
      mysql_root: C:\Progra~1\MySQL\MySQLs~1.0
      library_dirs: %(mysql_root)s\lib\opt
      include_dirs: %(mysql_root)s\include
      libraries: mysqlclient zlib wsock32 advapi32

      extra_compile_args:/Zi /Dversion_info=(1,2,2,'beta',2) /Dversion=1.2.2b2

      extra_link_args:/DEBUG /NODEFAULTLIB:msvcrt

       

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.