[Zope] ZMySQLDA fails to compile

David Parker daevidparker@yahoo.com
Tue, 23 May 2000 11:35:54 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0015_01BFC4AB.0DF58870
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I fixed my own problem. The version of MySQL that I installed from =
source appended an extra directory (mysql) to the include and lib =
directories. I modified my Setup to reflect the full paths below.
/usr/web/databases/mysql/include/mysql
/usr/web/databases/mysql/lib/mysql

I then ran into a problem where I could not import MySQL from python. I =
kept getting;
ImportError: libmysqlclient.so.6
Turns out I had to modify /etc/ld.so.conf to reflect the full path to =
the libmysqlclient.so.6 object, then run ldconfig, then I could import =
MySQL into python.....

David
  ----- Original Message -----=20
  From: David Parker=20
  To: zope@zope.org=20
  Sent: Tuesday, May 23, 2000 10:38 AM
  Subject: [Zope] ZMySQLDA fails to compile


  Configuration: Mandrake 7.02 with the following;

  Zope 2.1.6-1=20
  python 1.5.2
  MySQL-python 0.2.1-1=20
  Mysql 3.22.32

  All the above were installed using binary RPMs except for Mysql =
database. The path to mysql is
  /usr/web/databases/mysql
  I have a symbolic link to mysql at=20
  /usr/local/mysql

  I've downloaded and extracted ZMySQLDA  1.1.4 to /usr/share/zope

  From the following location=20
  /usr/share/zope/lib/python/Products/ZMySQLDA/src
  I've executed=20
  make -f Makefile.pre.in boot
  make

  (I've tried editing Setup using the default and following two paths)

  # MySQLmodule MySQLmodule.c -I/usr/local/mysql/include =
-I/usr/include/mysql -L/u
  sr/local/mysql/lib -L/usr/lib/mysql -lmysqlclient -lm

  # MySQLmodule MySQLmodule.c -I/usr/local/mysql/include =
-L/usr/local/mysql/lib -l
  mysqlclient -lm

  MySQLmodule MySQLmodule.c -I/usr/web/databases/mysql/include =
-L/usr/web/database
  s/mysql/lib -lmysqlclient -lm

  I get the following error every time...

  (mysql.h exists at /usr/web/databases/mysql/include/mysql/mysql.h)

  [root@davweb src]# make
  gcc -fPIC  -I/usr/local/mysql/include -O3 -fomit-frame-pointer =
-fno-exceptions -
  fno-rtti -pipe -s -mpentium -mcpu=3Dpentium -march=3Dpentium =
-ffast-math -fexpensive
  -optimizations -I/usr/include/python1.5 -I/usr/include/python1.5 =
-DHAVE_CONFIG_H
   -c ./MySQLmodule.c
  ./MySQLmodule.c:160: mysql.h: No such file or directory
  ./MySQLmodule.c:166: parse error before `MYSQL'
  ./MySQLmodule.c:166: warning: no semicolon at end of struct or union
  ./MySQLmodule.c:167: warning: data definition has no type or storage =
class
  ./MySQLmodule.c:170: parse error before `}'
  ./MySQLmodule.c:170: warning: data definition has no type or storage =
class
  ./MySQLmodule.c:174: parse error before `MYSQL_RES'
  continues............

------=_NextPart_000_0015_01BFC4AB.0DF58870
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3017.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I fixed my own problem. The version of =
MySQL that I=20
installed from source appended an extra directory (mysql) to the include =
and lib=20
directories. I modified my Setup to reflect the full paths =
below.</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>/usr/web/databases/mysql/include/mysql</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>/usr/web/databases/mysql/lib/mysql</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I then ran into a problem where I could =
not import=20
MySQL from python. I kept getting;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ImportError: =
libmysqlclient.so.6</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Turns out I had to modify =
/etc/ld.so.conf to=20
reflect the full path to the libmysqlclient.so.6 object, then run =
ldconfig, then=20
I could import MySQL into python.....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>David</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:daevidparker@yahoo.com" =
title=3Ddaevidparker@yahoo.com>David=20
  Parker</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:zope@zope.org"=20
  title=3Dzope@zope.org>zope@zope.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, May 23, 2000 =
10:38=20
AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Zope] ZMySQLDA fails =
to=20
  compile</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Configuration: Mandrake 7.02 with the =

  following;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Zope 2.1.6-1 <BR>python =
1.5.2<BR>MySQL-python=20
  0.2.1-1 <BR>Mysql 3.22.32<BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>All the above were installed using =
binary RPMs=20
  except for Mysql database. The path to mysql is</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>/usr/web/databases/mysql</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I have a symbolic link to mysql at =
</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>/usr/local/mysql</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I've downloaded and extracted =
ZMySQLDA&nbsp;=20
  1.1.4 to /usr/share/zope</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>From the following location =
</FONT></DIV>
  <DIV><FONT face=3DArial=20
  size=3D2>/usr/share/zope/lib/python/Products/ZMySQLDA/src</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I've executed </FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>make -f Makefile.pre.in =
boot</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>make</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>(I've tried editing Setup using the =
default and=20
  following two paths)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2># MySQLmodule MySQLmodule.c=20
  -I/usr/local/mysql/include -I/usr/include/mysql =
-L/u<BR>sr/local/mysql/lib=20
  -L/usr/lib/mysql -lmysqlclient -lm</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR># MySQLmodule MySQLmodule.c=20
  -I/usr/local/mysql/include -L/usr/local/mysql/lib -l<BR>mysqlclient=20
  -lm</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>MySQLmodule MySQLmodule.c=20
  -I/usr/web/databases/mysql/include -L/usr/web/database<BR>s/mysql/lib=20
  -lmysqlclient -lm</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I get the following error every=20
  time...</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>(mysql.h exists at=20
  /usr/web/databases/mysql/include/mysql/mysql.h)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>[root@davweb src]# make<BR>gcc =
-fPIC&nbsp;=20
  -I/usr/local/mysql/include -O3 -fomit-frame-pointer -fno-exceptions=20
  -<BR>fno-rtti -pipe -s -mpentium -mcpu=3Dpentium -march=3Dpentium =
-ffast-math=20
  -fexpensive<BR>-optimizations -I/usr/include/python1.5=20
  -I/usr/include/python1.5 -DHAVE_CONFIG_H<BR>&nbsp;-c=20
  ./MySQLmodule.c<BR>./MySQLmodule.c:160: mysql.h: No such file or=20
  directory<BR>./MySQLmodule.c:166: parse error before=20
  `MYSQL'<BR>./MySQLmodule.c:166: warning: no semicolon at end of struct =
or=20
  union<BR>./MySQLmodule.c:167: warning: data definition has no type or =
storage=20
  class<BR>./MySQLmodule.c:170: parse error before =
`}'<BR>./MySQLmodule.c:170:=20
  warning: data definition has no type or storage =
class<BR>./MySQLmodule.c:174:=20
  parse error before `MYSQL_RES'</FONT></DIV>
  <DIV><FONT face=3DArial=20
size=3D2>continues............</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0015_01BFC4AB.0DF58870--


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com