我的操作系统是Centos 7
当我运行 ldconfig -p
时,我可以看到“libcjson.so.1.5.7 (libc6,x86-64) =>/lib/libcjson.so.1.5.7”
然后我运行我的程序,它打印出
"libcjson.so: cannot open shared object file: No such file or directory"
最佳答案
最后,我发现ldconfig默认路径是/usr/lib
,但是我的动态库在/usr/本地/库
。所以我将此路径添加到 ldconfig 的配置中。
当我们复制库时,我们应该得到一些库只是符号链接(symbolic link)。复制到某处后无法正常使用。
关于c - libcjson.so : cannot open shared object file: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45708594/