Take the 2-minute tour ×

I've just compiled a test application using some libraries provided by a custom third party vendor. There is no installation/package manager. The application builds as expected. However, when I go to run it, it can't seem to find a necessary .so file (which I've got sitting in the same directory):

[diego@localhost Debug]$ ls
esdcan  libntcan.so.3  makefile  objects.mk  sources.mk  src
[diego@localhost Debug]$ ./esdcan
./esdcan: error while loading shared libraries: libntcan.so.3: cannot open shared object file: No such file or directory
[diego@localhost Debug]$ ldd esdcan
    linux-vdso.so.1 =>  (0x00007fff125ff000)
    libntcan.so.3 => not found
    libm.so.6 => /lib64/libm.so.6 (0x00000031c7600000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00000031c8600000)
    libc.so.6 => /lib64/libc.so.6 (0x00000031c7200000)
    /lib64/ld-linux-x86-64.so.2 (0x00000031c6e00000)

I'm missing some step I'm sure, I'm just completely unaware of what that step is.

share|improve this question
add comment

4 Answers

up vote 4 down vote accepted

Run ldconfig after completing the build, as well as making sure that the current directory is inside your /etc/ld.so.conf file so that the current directory is a trusted directory to look for shared libraries.

share|improve this answer
That did it, thanks! –  iegod Aug 24 '11 at 17:10
add comment

Set LD_LIBRARY_PATH env variable to current directory

[diego@localhost Debug]$ LD_LIBRARY_PATH=. ./esdcan
share|improve this answer
add comment
/etc/ld.so.conf           File containing a list of colon, space, tab,  new-
                          line,  or  comma-separated  directories in which to
                          search for libraries.

Also you can set the $LD_LIBRARY_PATH environment variable.

share|improve this answer
add comment

You can copy it into somewhere like /usr/lib (which is a bit invasive), or you can try setting LD_LIBRARY_PATH=[absolute(?) path containing libntcan.so.3]:LD_LIBRARY_PATH before running.

share|improve this answer
add comment

Your Answer


