User forums > Help

cannot open shared object file: No such file or directory

(1/2) > >>

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:


--- Code: ---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#

--- End code ---

I'm not sure about what to do... any ideas?  :(

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.

wxLearner:
The environment variable LD_LIBRARY_PATH can be used.

--- Code: (shell) ---$ export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
--- End code ---

Pecan:
Google for ldconfig and "linux shared lib search"

wxLearner:
IMHO here is a good explanation of shared objects.

Navigation

[0] Message Index

[#] Next page

Go to full version