3

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

Tarak Shah
  • 87
  • 1
  • 11

1 Answers1

2

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)

Phantom Lord
  • 360
  • 3
  • 12
  • bash: ./Dahuatest1: No such file or directory – Tarak Shah Dec 06 '17 at 12:12
  • ./Dahuatest1 - is the path to your executable file. I took it from your question. Just modify it to the correct path. As well, put the correct path to "dll" folder after LD_LIBRARY_PATH= – Phantom Lord Dec 06 '17 at 12:13
  • @PhantomLord I have the same problem and did temporary solve it by setting LD_LIBRARY_PATH in environment settings. CodeLite can run executable as expected. However, if I run executable in commandline, it fails. I made .sh that sets LD_LIBRARY_PATH and then starts executable which works. However, I would prefer if I can just compile executable that will search for .so files in path relative to executable path. Is there any way to do that? – Siniša Nov 03 '19 at 01:42