here's my code
Code:
#include <stdio.h>
#include <mysql.h>
MYSQL db;
int main( int argc, char *argv[] )
{
fprintf( stderr, "hello" );
mysql_init( &db );
mysql_real_connect( &db, "host", "user", "passwd", "database", 0, NULL, 0 );
fprintf( stderr, "%d\n", mysql_ping( &db ) );
mysql_close( &db );
return 0;
}
compiles and links without any error
Code:
gcc -c -I/usr/local/mysql4/include/mysql test.c
gcc -o test test.o -L/usr/local/mysql4/lib/mysql -lmysqlclient
When i use gcc to compile a simple C file with no embedded MySQL
and without the above options it runs perfectly.
it's the first time i use gcc and try to work on a Unix environment
any help would be greatly appreciated,
thanks