LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   library missing:No such file or directory error(all files and paths are set properly (https://www.linuxquestions.org/questions/linux-newbie-8/library-missing-no-such-file-or-directory-error-all-files-and-paths-are-set-properly-709957/)

venky.kv 03-07-2009 11:26 PM

library missing:No such file or directory error(all files and paths are set properly
 
Hi everyone, i am new to linux. i have an old system which has red hat installed in it. i have some c files,some libraries and binaries that have been generated from a make file which links those libraries and complies the c file. i am able to run the binary quite well( ./filename).

I backed up the binary file and ran the makefile again which generated a new binary(executable) file. It got successfully compiled without any errors. now when i am trying to run the program, i am getting an error as library is missing ( no such file or directory). Both the executables(new one and backed-up one) came from the same source. The old executable is running fine but the new one is unable to link the libraries.

i thought that the make file couldnt link the libraries properly , so first i gave wrong path and tried to compile and it gave library linking error, so i un-did all the changes and ran the make file again, but still the executable is giving same error.

i tried everything ( setting library path using LD_LIBRARY_PATH, setting the permission of libraries to read/write etc) but still no use. I am clueless about why the old executable is running fine and new one generated from same source code is giving an error.

please kindly help me out.


Thanks in advance.

paulsm4 03-08-2009 03:12 AM

Hi -

1. You can run "ldd EXENAME" to find what libraries are needed (including the one(s) you might know about from the error message

2. It's entirely possible to build a program (with shared dependencies) and not be able to run it (if the runtime dependencies aren't actually available).

3. It's also entirely possible to build the same program (from source) such that it has *different* dependencies (for example, if you build on different machines, with different libraries; or if you build with different link switches). There are many other scenarios - you didn't give enough information to be certain of the exact cause.

In any case, your best bet is to try installing any missing dependencies (after making sure your build and target machines are as close as possible to exactly the same versions of all libraries).

'Hope that helps .. pSM

venky.kv 03-08-2009 11:59 PM

Hi pSM,
Thanks for the reply.


--I am getting the following error:
./test1:error while loading shared libraries : liblagr.so: cannot open shared object file: No such file or directory

-- ran the command lld test1 and i got following error.

linux-gate.so.1 => (0xffffe000)
liblagr.so => not found
libtriclops.so => not found
libpthread.so.0 => /lib/libpthread.so.0 (0xb7ec5000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7de5000)
libm.so.6 => /lib/libm.so.6 (0xb7dbf000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7db4000)
libc.so.6 => /lib/libc.so.6 (0xb7c94000)
/lib/ld-linux.so.2 (0xb7eeb000)

-- the make fil has the following lines in it.

LDFLAGS = \
-L. \
-L../../lib \


-- and the file liblagr.so is present there only
my .c file is located at /home/venky/examples/trials/test1.c
and the libraries are located at /home/venky/lib/

when i am trying to find liblagr.so using locate command i am getting the following error:
locate: warning: database `/var/lib/locatedb' is more than 8 days old


is this anything to do with the problem??


Thanks once again.

paulsm4 03-09-2009 10:49 AM

Hi -

1. You seem to be missing both libtriclops and liblagr.

2. The easiest way to find them is:
Quote:

find / -name "*triclops*" -print 2>/dev/ null

find / -name "*lagr*" -print 2>/dev/ null
3. Another way is to refer back to the original source you're trying to build (README, BUILD, etc: whatever files look interesting) and see where [i]they[i/] suggest downloading "libtriclops" and "liblagr" from

4. You might also be able to install an RPM for one or both of these packages.

PS:
My guess is you're trying to build/simulate a robot, and the "Triclops" in question is Point Grey's Stereo Vision:

http://www.ptgrey.com/products/triclopsSDK/index.asp

If so, your best bet is to go back to the original source you started with, and search for "README" files in that, or post questions to the original authors.


All times are GMT -5. The time now is 12:29 PM.