编译安装时出现依赖文件故障的解决方法
编译安装时出现/usr/bin/ld: cannot find -lxxx故障的解决方法 编译安装时出现/usr/bin/ld: cannot find -lmysqlclient_r故障的解决方法
1、查看依赖文件位置locate libmysqlclient_r
locatelibmysqlclient_r /usr/lib64/mysql/libmysqlclient_r.so /usr/lib64/mysql/libmysqlclient_r.so.16 /usr/lib64/mysql/libmysqlclient_r.so.16.0.0
发现文件不存在
ll/usr/lib64/mysql/libmysqlclient_r.so ll/usr/lib64/mysql/libmysqlclient_r.so.16 ll/usr/lib64/mysql/libmysqlclient_r.so.16.0.0
查找系统是否存在该文件
find/-namelibmysqlclient_r* /usr/lib64/libmysqlclient_r.so.14.0.0 /usr/lib64/libmysqlclient_r.so.12 /usr/lib64/libmysqlclient_r.so.12.0.0 /usr/lib64/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient_r.so.16 /usr/lib64/libmysqlclient_r.so.15.0.0 /usr/lib64/libmysqlclient_r.so.15 /usr/lib64/libmysqlclient_r.so.14
2、把找到的文件指向locate中定义的文件
ln-sf/usr/lib64/libmysqlclient_r.so.16/usr/lib64/mysql/libmysqlclient_r.so ln-sf/usr/lib64/libmysqlclient_r.so.16/usr/lib64/mysql/libmysqlclient_r.so.16 ln-sf/usr/lib64/libmysqlclient_r.so.16/usr/lib64/mysql/libmysqlclient_r.so.16.0.0
3、修改配置和环境变量
vim/etc/ld.so.conf includeld.so.conf.d/*.conf /usr/local/ssl/lib /usr/lib64/mysql/ /usr/lin64/ ldconfig vim~/.bashrc exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/mysql/ exportLIBRARY_PATH=/usr/lib64/mysql/:$LIBRARY_PATH source~/.bashrc
4、重新编译
makeclean make
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11