我正在执行以下编译命令行:
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
我将不胜感激任何建议
谢谢
我猜测运行时错误是因为LD_LIBRARY_PATH环境变量中未包含路径“ /home/admin/Github/casablanca/Release/build.debug/Binaries/”。如果在要运行的shell中执行“ echo $ LD_LIBRARY_PATH”,则应确认。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句