Web Hosting Talk







View Full Version : MySQL and C++


H2
06-03-2001, 07:19 AM
When I compile my C++ file i have error

gcc -I/usr/include/mysql myfile.c -L/usr/lib/mysql -lmysqlclient -o myfile.cgi
it gives me this error: /usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_uncompress':
my_compress.o(.text+0x97): undefined reference to `uncompress'
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function
`my_compress_alloc':
my_compress.o(.text+0x12b): undefined reference to `compress'
collect2: ld returned 1 exit status

Even is i add -LZ the programm is not working correctly and sometimes get internal server error
Why? :(

jks
06-03-2001, 03:58 PM
You say that if you add -lZ the program compiles fine?

Then I would say that is probably a bug in your program. Remember to check for errors whenever you run a mysql function.

Also make sure, that your mysql-devel and mysql RPMs match (if you have installed by RPM).

--
Jens Kristian Søgaard, Mermaid Consulting I/S,
jens@mermaidconsulting.dk,
http://www.mermaidconsulting.com/