以下命令返回
sudo find / -name libPocoNet.so
/home/sandeep/server2/poco/cmake-build/lib/libPocoNet.so
/home/sandeep/server/cmake_build/lib/libPocoNet.so
/home/sandeep/server/poco/cmake_build/lib/libPocoNet.so
/home/sandeep/server/poco/lib/Linux/x86_64/libPocoNet.so
/usr/local/lib/libPocoNet.so
编译我正在使用的代码
g++ poco.cpp -lPocoNet
执行时
我遇到了错误 加载共享库时出错:libPocoNet.so.60:无法打开共享库文件:没有这样的文件或目录
我如何构建源代码
$ git clone -b master https://github.com/pocoproject/poco.git
$ cd poco
$ mkdir cmake-build
$ cd cmake-build
$ cmake .. && cmake --build .
$ sudo cmake --build . --target install
$ cd ..
$ ./configure
$ make -s -j4
$ cd cmake-build
$ make -s -j4
$ cd ..
$ sudo make install
$ cd cmake-build
$ sudo make install
-----------使用-------------------
解决sandeep@sandeep:~$ LD_LIBRARY_PATH=/usr/local/lib
sandeep@sandeep:~$ export LD_LIBRARY_PATH
sandeep@sandeep:~$ g++ poco.cpp -lPocoNet
sandeep@sandeep:~$ ./a.out
答案 0 :(得分:0)
我将所有Poco库从/ usr / local / lib移到了/ usr / lib /,对我有用。