Hi, I have written the following code using C-API and would like to retrieve the info from MYSQL. But it gives me error messages. Please let me know where iam going wrong. the code and error messages are : #include <stdio.h> #include <mysql/mysql.h>
main() { int sel; MYSQL *mysql=NULL; mysql_init(mysql); if(mysql == NULL) { printf("\n MySQL unable to intialise\n"); exit(-1); } mysql_real_connect(mysql,"23.22.2.2","user","pwd","db_name",0,NULL,0); sel = mysql_query(mysql, "select e-no,ename from employee"); printf("sel %d\n",sel); } produces the following error messages. /tmp/ccPhnnJk.o: In function `main': /tmp/ccPhnnJk.o(.text+0x14): undefined reference to `mysql_init' /tmp/ccPhnnJk.o(.text+0x5a): undefined reference to `mysql_real_connect' /tmp/ccPhnnJk.o(.text+0x6d): undefined reference to `mysql_query' collect2: ld returned 1 exit status Regards Uday --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php