赞
踩
在linux下整合log4cpp日志框架时,出现了下面的错误:当加载共享库时出错,找不到共享库 XXXX
[root@hecs-207177 cworkspace]# ./Log4cppTest
./Log4cppTest: error while loading shared libraries: liblog4cpp.so.5: cannot open shared object file: No such file or directory
此处我以上面报错为例:
find / -name 共享库
[root@hecs-207177 cworkspace]# find / -name liblog4cpp.so.5
/usr/local/lib/liblog4cpp.so.5
/usr/src/log4cpp/src/.libs/liblog4cpp.so.5
[root@hecs-207177 cworkspace]# vim /etc/ld.so.conf
注意,此处只需要将 lib 目录加入即可,如下图:
ldconfig
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。