./test:加载共享库时出错:libcpprest.so.2.8:无法打开共享库文件:没有这样的文件或目录

不锈钢

我正在执行以下编译命令行:

g++ -std=c++11 -I/home/admin/Github/casablanca/Release/include -L/home/admin/Github/casablanca/Release/build.debug/Binaries test.cc -o test -lboost_system -lcrypto -lssl -lcpprest

编译成功,但是在运行时出现此错误:

./test: error while loading shared libraries: libcpprest.so.2.8: cannot open shared object file: No such file or directory

尽管文件libcpprest.so.2.8存在于指定的位置:

admin:$ ls /home/admin/Github/casablanca/Release/build.debug/Binaries/libcpprest.so*
/home/admin/Github/casablanca/Release/build.debug/Binaries/libcpprest.so
/home/admin/Github/casablanca/Release/build.debug/Binaries/libcpprest.so.2.8

我将不胜感激任何建议

谢谢

用户1621986

我猜测运行时错误是因为LD_LIBRARY_PATH环境变量中未包含路径“ /home/admin/Github/casablanca/Release/build.debug/Binaries/”。如果在要运行的shell中执行“ echo $ LD_LIBRARY_PATH”,则应确认。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档