• Welcome to The Network People Support Forums. Please login or sign up.

UCSPI-TCP MySQL patch installation error

Started by stevenlooi, December 23, 2005, 01:12:42 PM

Previous topic - Next topic

stevenlooi

I encountered errors during compiling the ucspi-tcp Mysql patch Version 2 in Redhat 8 because I installed the MySQL binary, but didn't have the MySQL-devel and client libraries.

Hope this guide will help those that encounter similar errors.

The errors were like following:

db.c:4:19: mysql.h: No such file or directory
db.c:18: parse error before '*' token

and

dns.a time.a unix.a byte.a `cat socket.lib`
db.o(.text+0x15): In function `open_db':
: undefined reference to `mysql_init'

Download and install the Libraries and header files (MySQL-devel-5.0.17-1.i386.rpm) and Dynamic client libraries (MySQL-shared-5.0.17-1.i386.rpm).

After installing the RPMs, configure the dynamic linker runtime bindings.
ldconfig -v

Check to make sure it's configured.
ldconfig -v |grep mysql

Should returns:
     libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
     libmysqlclient.so.15 -> libmysqlclient.so.15.0.0

Search for the location of the MySQL-devel-5.0.17-1.i386.rpm files are installed.
rpm -ql MySQL-devel |grep include

The files location from the above command is /usr/include/mysql. The mysql.h should be located here.

Edit the ucspi-tcp's conf-cc file.
gcc -O2 -I/usr/include/mysql

Search for the location of the MySQL-shared-5.0.17-1.i386.rpm files are installed.
rpm -ql MySQL-shared |grep lib

The files location from the above command is /usr/lib. The libmysqlclient_r.so.15 and libmysqlclient.so.15 should be located here.

Edit the ucspi-tcp's conf-ld file.
gcc -s -I/usr/include/mysql -L/usr/lib -lmysqlclient

Run 'Make' and it should now compile successfully.
Steven