1 编译报错
mysql.c:1:10: fatal error: mysql.h: No such file or directory
#include “mysql.h”
解决办法sudo apt-get install libmysqlclient-dev
2 编译命令
gcc mysql.c -o mysql -I /usr/include/mysql
报错collect2: error: ld returned 1 exit status
3 修改
gcc mysql.c -o mysql -I /usr/include/mysql -lmysqlclient -Wall -g
编译成功!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)