返回信息流求教万能的byr,在Linux下使用数据库,总是找不到mysql.h
如果把mysql.h当库函数,会提示找不到头文件;
如果直接把mysql.h路径搞过来,又提示库函数都没有定义;
我自己find了一下,系统里是有这个头文件的,并且库函数也都有。
以下是两种错误情况:
1、
#include <mysql.h>
[root@localhost mysqlscript]# gcc -g -o all all.c
all.c:4:19: error: mysql.h: No such file or directory
2、
#include "/usr/local/ssep/mysql/include/mysql/mysql.h"
[root@localhost mysqlscript]# gcc -g -o all all.c
/tmp/ccp8uqlP.o: In function `guard_mysql_connet':
/home/dengweitao/study/mysqlscript/all.c:9: undefined reference to `mysql_init'
/home/dengweitao/study/mysqlscript/all.c:10: undefined reference to `mysql_real_connect'
/home/dengweitao/study/mysqlscript/all.c:12: undefined reference to `mysql_error'
/tmp/ccp8uqlP.o: In function `guard_mysql_query':
/home/dengweitao/study/mysqlscript/all.c:20: undefined reference to `mysql_query'
/home/dengweitao/study/mysqlscript/all.c:22: undefined reference to `mysql_error'
唉,这可怎么搞,请大牛们指教,拜托了~
这是一条镜像帖。来源:北邮人论坛 / cpp / #45522同步于 2010/11/1
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
Linux 下找不到mysql.h,求指教
niubirenttt
2010/11/1镜像同步1 回复
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复