请教mysql在linux下的c编程问题
很笨的问:
使用mysql的c语言API编写c程序,需要调用哪些头文件和库文件?请见下面函数
#include <stdio.h>
#include <stdlib.h>
#include <mysql.h>
int main()
{
MYSQL mysql;
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,"localhost","root","passwd","",0,NULL,0))
{
fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
}
return 0;
}
编译包含lib库中的-lmysqlclient, 为什么编译不能通过,还需要加些什么?
非常感谢您的回答!