[Zope-DB] Re: ZMySQLdb

Martin Gebert Murphy@members.netsolution-net.de
Tue, 01 Apr 2003 22:44:52 +0200


Eron Lloyd schrieb:
> Has anyone gotten MySQLdb to build on SuSE 8.1? Seems like something strange 
> is going on, as I couldn't get mxODBC to build either. I'm attempting to get 
> Zope 2.6.1 connected to MySQL 4.0.12 using either ZMySQLdb or mxODBC. Both 
> Zope & MySQL are working fine. Using gcc 3.2, I get screen after screen of 
> undeclared variable errors:
> 
> building '_mysql' extension
> gcc -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 
> -mcpu=i686 -fmessage-length=0 -fPIC -fPIC -I/usr/include/mysql 
> -I/usr/local/include/mysql -I/usr/local/mysql/include/mysql 
> -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o
> _mysql.c:41:19: mysql.h: No such file or directory
> _mysql.c:42:26: mysqld_error.h: No such file or directory
> _mysql.c:43:20: errmsg.h: No such file or directory
> _mysql.c:73: parse error before "MYSQL"
> ...
> _mysql.c: At top level:
> _mysql.c:1859: parse error before '*' token
> _mysql.c: In function `_mysql_ResultObject_getattr':
> _mysql.c:1864: `self' undeclared (first use in this function)
> _mysql.c:1864: `name' undeclared (first use in this function)
> ...
> 
> It looks like something in the build process isn't being seen (mysql headers), 
> but I'm no C expert. MySQL is located in /usr/local/mysql.
> 

Seems like the development package of MySQL is missing; does SuSE 8.1 have a separate RPM for that (could be named mysql-dev or similar)? Search for mysql.h in YaST...
If you already have it installed, give mysql-python (I presume that's what you're compiling) the path to the header files. See ./configure --help for the options.
Else, deinstall the SuSE MySQL RPM and get one from mysql.com, or build it from source; with that you should have the environment needed.

Martin