#include <my_global.h>
#include <mysql.h>
int main(int argc, char **argv)
{
printf("MySQL client version: %s\n", mysql_get_client_info());
}
~$ gcc -o mysql-test MySQL-Test.c
im trying to execute this test program from terminal but get the following error message:
/tmp/cceEmI0I.o: In function main': MySQL-Test.c:(.text+0xa): undefined reference tomysql_get_client_info’
what is wrong? my system is ubuntu
MySQLcomes with a special script calledmysql_config. It provides you with useful information for compiling your MySQL client and connecting it to MySQL database server.Pass
--libsoption – Libraries and options required to link with the MySQL client library.Typical Output:
Now you can add this to your compile/link line: