News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

cannot open shared object file: No such file or directory

Started by kelo81, April 24, 2007, 04:22:04 AM

Previous topic - Next topic

kelo81

Hello everybody. I'm working on a shared lib with codeblocks. I've created a workspace storing two projects, the first one is named casandra, and it's a shared lib (libCasandra.so). And the other project is a console application which uses the shared lib. So, both resulting files (the binary and the shared lib) are under the same directory, I told Codeblocks to put them under the same path, and use it as a working directory for the binary file.
The problem: If I execute the binary file, it runs perfectly, as expected. But if i try to execute the binary file from a terminal, I get a message saying that the file doesn't exist   :( even if the file is under the same directory... I can note this is not like Windows  :( . Here are the results:


bash-3.1# ls
Test libCasandra.so
bash-3.1# ./Test
./Test: error while loading shared libraries: libCasandra.so: cannot open shared object file: No such file or directory
bash-3.1#


I'm not sure about what to do... any ideas?  :(
Ezequiel Ruiz
Tango/04 consultant
www.tango04.com

kelo81

I mean, If I run the binary project from Codeblocks it works OK, but if I try to execute the file from a terminal with ./ then it doesn't work.
Ezequiel Ruiz
Tango/04 consultant
www.tango04.com

wxLearner

The environment variable LD_LIBRARY_PATH can be used.
Code (shell) Select
$ export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH

Pecan


wxLearner


kelo81

OK, I thought it was possible to do it like in Windows, bu putting the executable under the same directory than the shared. So I'll set the environment variable into the shell before running the binary  :D

Thanks!!
Ezequiel Ruiz
Tango/04 consultant
www.tango04.com