Installation-Related Issues
Problems When Linking with the MySQL Client Library
If you are linking your program and you get errors for unreferenced symbols that start with mysql_, like the following:
/tmp/ccFKsdPa.o: In function `main': /tmp/ccFKsdPa.o(.text+0xb): undefined reference to `mysql_init' /tmp/ccFKsdPa.o(.text+0x31): undefined reference to `mysql_real_connect' /tmp/ccFKsdPa.o(.text+0x57): undefined reference to `mysql_real_connect' /tmp/ccFKsdPa.o(.text+0x69): undefined reference to `mysql_error' /tmp/ccFKsdPa.o(.text+0x9a): undefined reference to `mysql_close'
you should be able to solve this by adding -Lpath-to-the-mysql-library -lmysqlclient last on your link line.
If you get undefined reference errors for the uncompress or compress function, add -lz last on your link line and try again!
If you get undefined reference errors for functions that should exist on your system, like connect, check the manpage for the function in question for which libraries you should add to the link line!
If you get undefined reference errors for functions that don’t exist on your system, like the following:
mf_format.o(.text+0x201): undefined reference to `__lxstat'
it usually means that your library is compiled on a system that is not 100% compatible with yours. In this case you should download the latest MySQL source distribution and compile this yourself. See Section 2.3.
If you are trying to run a program and you then get errors for unreferenced symbols that start with mysql_ or that the ...