Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open shared object file: No such file or directory; Running or Debugging in Eclipse

On Ubuntu, I have a C++ app in Eclipse. The application compiles fine and I can run the app from the command line.

But when I try to debug it or run it with Eclipse, the error :

"Cannot open shared object file: No such file or directory" is thrown on a shared library.

I've set LD_LIBRARY_PATH in my bashrc file and also set an LD_LIBRARY_PATH environment variable in both the Run Configuration and Debug Configuration to :

/home/behlingb/Documents/api_libs/FileGDB_API/lib

What else am I missing here to get Eclipse to run this?



UPDATE

There is only one shared object file this application requires, and that file is from a 3rd party API download. I just found that if I place the shared object inside the directory the executable is in, it will debug in Eclipse. Is there a way to specify a different directory so I dont have to copy the file for every project?

like image 329
user714157 Avatar asked Jan 21 '13 22:01

user714157


1 Answers

I'm using the Kepler version of Eclipse.

  1. In Eclipse click on Run then Debug Configurations
  2. Click on the Environment Tab
  3. Click on New
  4. Add LD_LIBRARY_PATH and set its value to the directory containing the library
  5. restart Eclipse
like image 170
monzie Avatar answered Sep 21 '22 12:09

monzie