#47 Build under current Cygwin fails

MySQLdb-0.9.2
closed
Andy Dustman
MySQLdb (285)
5
2012-09-19
2002-12-20
Anonymous
No

(Not sure about Category and Group classification)

setup.py has the following Cygwin-related configuration:

elif sys.platform == "cygwin":
include_dirs = ['/c/mysql/include']
library_dirs = ['/c/mysql/lib']
extra_compile_args.append('-DMS_WIN32')

but Cygwin does not have /c as reference to C: where
Win MYSQL is installed by default, and so the build
process gives lots of errors because of the missing
include files.

Better references would be to /cygdrive/c as in:

elif sys.platform == "cygwin":
include_dirs = ['/cygdrive/c/mysql/include']
library_dirs = ['/cygdrive/c/mysql/lib']
extra_compile_args.append('-DMS_WIN32')

This reduces the compile errors to the following
(initial trace messages dropped)


[...]
building '_mysql' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-DUSE_DL_IMPORT -I/cygdrive/c/mysq
l/include -I/usr/include/python2.2 -c _mysql.c -o
build/temp.cygwin-1.3.17-i686-
2.2/_mysql.o -DMS_WIN32
In file included from _mysql.c:41:
/cygdrive/c/mysql/include/mysql.h:47:1: warning:
"STDCALL" redefined
In file included from /usr/include/w32api/windows.h:48,
from _mysql.c:34:
/usr/include/w32api/windef.h:105:1: warning: this is
the location of the previou
s definition
_mysql.c:2005: initializer element is not constant
_mysql.c:2005: (near initialization for
`_mysql_ConnectionObject_Type.tp_alloc')

_mysql.c:2006: initializer element is not constant
_mysql.c:2006: (near initialization for
_mysql_ConnectionObject_Type.tp_new') _mysql.c:2007: initializer element is not constant _mysql.c:2007: (near initialization for_mysql_ConnectionObject_Type.tp_free')
_mysql.c:2094: initializer element is not constant
_mysql.c:2094: (near initialization for
_mysql_ResultObject_Type.tp_alloc') _mysql.c:2095: initializer element is not constant _mysql.c:2095: (near initialization for_mysql_ResultObject_Type.tp_new')
_mysql.c:2096: initializer element is not constant
_mysql.c:2096: (near initialization for
`_mysql_ResultObject_Type.tp_free')
error: command 'gcc' failed with exit status 1


I haven't so far been able to make head or tails of
that, hence this report.

/ath@algonet.se

Discussion

  • Logged In: YES
    user_id=163326

    These error messages are very familiar to me. I thought I
    made a patch for these once. I wonder if it didn't end up in
    MySQLdb's CVS.

    You can search Google for these error messages, they're the
    usually the only problem when porting Python extensions from
    Unix to Windows. The workaround is to fill these slots in
    the init method of the module instead.

     
  • Andy Dustman
    Andy Dustman
    2003-07-07

    Logged In: YES
    user_id=71372

    I think these are fixed

     
  • Andy Dustman
    Andy Dustman
    2003-07-07

    Logged In: YES
    user_id=71372

    This has been fixed in the current CVS tree.