I admit I'm a newbie to the C backend for MySQL. Anyway, here's my problem: I wrote a simple program to test the client library, but every mysql_* symbol is reported as unresolved.
Also, I might add, I am POSITIVE that libmysqlclient.a exists in /usr/local/mysql/lib.
And I compiled with this command:
Is there something obvious I'm doing wrong?
I'm using MySQL 4.0.13 and gcc 2.95.3.
Please help, thanks in advance.
Will
Also, I might add, I am POSITIVE that libmysqlclient.a exists in /usr/local/mysql/lib.
Code:
#include <mysql.h>
#include <stdio.h>
int main ()
{
char *mysqlClientInfo;
mysqlClientInfo = mysql_get_client_info();
if (mysqlClientInfo != NULL) {
printf("%s",mysqlClientInfo);
return 0;
}
return 1;
}
Code:
$ gcc -I/usr/local/mysql/include -L/usr/local/mysql/lib -lmysqlclient simplemysqltest.c
simplemysqltest.c: In function `main':
simplemysqltest.c:8: warning: assignment discards qualifiers from pointer target type
/tmp/ccVTW7ra.o: In function `main':
/tmp/ccVTW7ra.o(.text+0x7): undefined reference to `mysql_get_client_info'
collect2: ld returned 1 exit status
I'm using MySQL 4.0.13 and gcc 2.95.3.
Please help, thanks in advance.
Will