运行程序时无法加载共享库

时间:2016-06-22 20:10:43

标签: linux shared-libraries

在cpp程序中加载共享库时,我遇到了一个奇怪的问题。执行make文件后,它可以正常工作 -

LIB_RELEASE = $(LIB)-lopencv_highgui -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lmmcheng_github -lgomp

但是当我使用由此make文件生成的输出文件来运行它时,它会给出错误 -

./bin/mmcheng_densecut: error while loading shared libraries: libmmcheng_github.so: cannot open shared object file: No such file or directory

PS 我已将libmmcheng_github.so放在文件夹/ usr / local / lib

错误截图 - See during makefile all works fine however later it fails

由于

1 个答案:

答案 0 :(得分:1)

尝试设置LD_LIBRARY_PATH环境字符串,阅读here

虽然这是discouraged practice,但至少它会帮助你向前迈出一步......

另请阅读this question and answer

相关问题