首页 > 代码库 > ./ProjectC: error while loading shared libraries: libProjectC.so: cannot open shared object file: No such file or directory
./ProjectC: error while loading shared libraries: libProjectC.so: cannot open shared object file: No such file or directory
时间: 2014-7-20 11:30
地点: andon
问题: 研究xu库文件的创建,编译-链接通过后,执行文件时./ProjectC
./ProjectC: error while loading shared libraries: libProjectC.so: cannot open shared object file: No such file or directory
不能打开动态链接库
解决:makefile文件中,库文件 libProjectC.so已经添加到./install中,但还是报错
#lib directory
LIBDIR = -L ./
LIBDIR = -L ../install
#lib which the link program need
LIBS = $(LIBDIR) -l$(PROJECT)
LIBS += -lpthread
LIBS += -lProjectA
最后发现是/etc/ld.so.conf中未添加路径/root/workspace/Project/install
include ld.so.conf.d/*.conf
/usr/local/lib
/root/workspace/Project/install
添加路径后,shell:ldconfig
重新编译即可成功
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。