chinmay
chinmay

Reputation: 361

error while loading shared libraries: libPocoNet.so.60: cannot open shared object file: No such file or directory

The below command returns

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

to compile code I am using

g++ poco.cpp  -lPocoNet

while execution

I am getting the error error while loading shared libraries: libPocoNet.so.60: cannot open shared object file: No such file or directory

how I built the source

$ 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

-----------solved using-------------------

sandeep@sandeep:~$ LD_LIBRARY_PATH=/usr/local/lib
sandeep@sandeep:~$ export LD_LIBRARY_PATH
sandeep@sandeep:~$ g++ poco.cpp -lPocoNet
sandeep@sandeep:~$ ./a.out

Upvotes: 2

Views: 4586

Answers (2)

peacism
peacism

Reputation: 31

if all necessary libs added to your CMakeList.txt just run the below line and run a.out app.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Upvotes: 1

Ravi Singh
Ravi Singh

Reputation: 1

I moved all Poco libraries from /usr/local/lib to /usr/lib/, it worked for me.

Upvotes: 0

Related Questions