是不是yum安装mysql的话就不会有libmysqlclient.a,也就不能进行c操作mysql了?
答案:1 悬赏:0 手机版
解决时间 2021-03-16 11:37
- 提问者网友:爱唱彩虹
- 2021-03-15 11:01
是不是yum安装mysql的话就不会有libmysqlclient.a,也就不能进行c操作mysql了?
最佳答案
- 五星知识达人网友:痴妹与他
- 2021-03-15 12:29
#include
#include
#include
#include "/usr/include/mysql/mysql.h"
int main(void)
{
MYSQL mysql;
mysql_init(&mysql);
printf("是否可以连接上MySQL数据库.\n");
return 0;
}
编译命令: gcc -o test test.c `mysql_config --cflags --libs`
报错:
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient_r.a when searching for -lmysqlclient_r
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status执行命令:gcc -o test test.c `mysql_config --cflags --libs`
报这个错:
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
#include
#include
#include "/usr/include/mysql/mysql.h"
int main(void)
{
MYSQL mysql;
mysql_init(&mysql);
printf("是否可以连接上MySQL数据库.\n");
return 0;
}
编译命令: gcc -o test test.c `mysql_config --cflags --libs`
报错:
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient_r.a when searching for -lmysqlclient_r
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status执行命令:gcc -o test test.c `mysql_config --cflags --libs`
报这个错:
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯