我正在编译此处找到的程序,在运行时出现错误:
这是我编译它的方法:
$ g++ -I/home/jpthomps/Desktop/pl-6.0.2/src main.cpp -L/usr/local/lib/swipl-6.0.2/lib/x86_64-linux -lswipl
main.cpp: In function ‘int main()’:
main.cpp:8:39: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
main.cpp:20:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
然后当我尝试运行编译后的程序时:
$ ./a.out
./a.out: error while loading shared libraries: libswipl.so.6.0.2: cannot open shared object file: No such file or directory
我是否需要在我的 .cpp 文件中添加一些内容来告诉它 libswipl.so.6.0.2 文件的位置?