cannot excute a C api to work with MySQL on Redhat 9.0 Linux
Posted by: Nguyen Cong Danh
Date: May 16, 2005 09:40PM

I already installed packages of MySQL: main server package, client package, development package into a computer with Redhat 9.0 Linux. C compiler was on this computer. Then I write the following programe:
/*connect1*
#include <stdlib.h>
#include <stdio.h>
#include "mysql.h"

int main(int argc, char *argv[]){
MYSQL *conn_ptr;
conn_ptr=mysql_init(NULL);
return 1;
}
I run the above program with the following command:
>gcc -I/usr/include/mysql connect1.c -o connect1 -L/usr/usr/lib/mysql -lmysqlclient
The compiler showed following errors:
/usr/lib/mysql/libmysqlclient.a(my_malloc.o)(.text+0x29): In function 'my_malloc': undefined reference to 'errno'
........
I do not know how to resolve this problem.
Please help me!
Mr. Danh (Vietnam student, Bangkok)

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.