在程序编译通过后,点击运行,会出现以下错误:error while loading shared libraries: libShared.so: cannot open shared object file: No such file or directory ,因为系统无法从默认位置找到动态链接库文件。修改系统默认搜索链接库的路径,程序即可顺利执行.
方法: sudo ldconfig <放so文件的目录>.
在程序编译通过后,点击运行,会出现以下错误:error while loading shared libraries: libShared.so: cannot open shared object file: No such file or directory ,因为系统无法从默认位置找到动态链接库文件。修改系统默认搜索链接库的路径,程序即可顺利执行.
方法: sudo ldconfig <放so文件的目录>.