Search code examples
c++linuxdllubuntu-16.04codelite

Error while loading shared libraries: No such file or directory even after using LD_LIBRARY_PATH and changing $PATH


I'm new to Linux environment. I'm trying to run my C++ files on Codelite and its giving me error which just won't go. I have a DLL folder of my Dahua SDK. It contains shared .so libraries. I'm getting this error since last 2 days and can't run my project!

./Dahuatest1: error while loading shared libraries: libdhnetsdk.so: cannot open shared object file: No such file or directory

I already tried:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tarak/Documents/General_NetSDK_Eng_Linux64_IS_V3.48.1.R.170623/NetSDK_Eng_Bin/Demo_Src/DLL

export LD_LIBRARY_PATH

ldconfig

which also includes my DLL folder. But still get the same error.

I also tried to change my path to my folder in ~/.bashrc:

export $PATH=$PATH:/home/tarak/Documents/General_NetSDK_Eng_Linux64_IS_V3.48.1.R.170623/NetSDK_Eng_Bin/Demo_Src/DLL

this too failed!

What should I do to get the output??

In codelite I've set Linker search path as my DLL folder. And compiler 'Include Path' also as my DLL folder

Here's a screenshot of my folder: Project file

DLL folder


Solution

  • Try

    export LD_LIBRARY_PATH=/home/tarak/Documents/General_NetSDK_Eng_Linux64_IS_V3.48.1.R.170623/NetSDK_Eng_Bin/Demo_Src/DLL && ./Dahuatest1
    

    As well, try moving (or better symlinking) you *.so files to a directory where the system automatically looks shared libraries for (e.g. /usr/local/lib)