0

I have a project path where I have created an executable testsd:

Caspian@Caspian-VirtualBox:~/TestProject/build/linux/debug/bin/testsd

The project directory and heirarchy is as following:

/TestProject
|-build/linux/debug/bin
|-ExtLib/folder/lib(containing .a and .so files)
|-ExtLib/folder/src(containing multiple sub folders with .cpp files)
|-ExtLib/folder/include(containing multiple sub folders with .cpp files)
|-src(containing multiple sub folders with .cpp files and mainc.pp)
|-tests(containing Runtests.cpp and catch.hpp files)   

The problem is when am running this executable (./testsd), I am encountering the following error:

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

The libuastackd.so files is contained in ExtLib/folder/lib and ExtLib/folder/src/stack/lib folders. Can anyone help, how can I overcome this problem?

Thanks rG

1 Answers1

0

You might set the LD_LIBRARY_PATH environment appropriately. See this. Read ld-linux.so(8).

There is some way to set LD_LIBRARY_PATH for your entire session, e.g. by editing appropriately ~/.login or ~/.bashrc or ~/.bashenv or ~/.profile etc ... and this would alter the behaviour of any program you start after, including some Eclipse IDE

Read Drepper's How To Write Shared Libraries, notably for other solutions -e.g. appropriate -Wl,-rpath settings (which is probably what you really should use).

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Thanks a lot it worked. Now I have a different senario. I also want to run executable via eclipse IDE, and again the same error shows. How to omit the same error in ecipse? –  Apr 09 '17 at 12:49
  • Configure your IDE, or your user account (e.g. thru `~/.bashrc` ....) appropriately – Basile Starynkevitch Apr 09 '17 at 15:15
  • I did not get you properly, can you please elaborate on this? –  Apr 09 '17 at 18:07