MySQL Errors and MySQL client Library
When using MySQL client Library, there is a possiblity to receive many errors in referance to MySQL. This can be solved by adding -Ldir_path -lmysqlclient at the end where dir_path mentiones pathname of the client library directory. In order to check this, the following command can be used -
shell> mysql_config --libs
For the undefined erros, please add add -lz to the end of the link
Is is also a possibility, that we may get undefined referance errors such as following -
mf_format.o(.text+0x201): undefined reference to `__lxstat'
This error is in respect to the compatibility of MySQL client library.
If in case you get undefined reference errors at the time of execution. If they start with mysql_ or if they mention that MySQL client library cannot be located. You will need to follow the following -
* Add the path to directory of libmysqlclient.so to LD_LIBRARY_PATH environment variable
* Add the path to the directory of libmysqlclient.so to the LD_LIBRARY environment variable.
Thereafter, copy libmysqlclient.so, so that the system can search for them. You can also update shared library through the command - ldconfig
|