Link to home
Start Free TrialLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

shared libraries

Hi,

I've got some 3rd party library trying to connect to some libs during runtime. I keep getting an error:

    libodbcinst.so.1: cannot open shared object file: No such file or directory.

I'm just wondering how I can figure out what file this library link is looking for - i'm new with linux and don't quite know what the be looking at.

Thanks
Avatar of skyper3
skyper3

You should install a package named odbcinst or similar
under debian etch it is called "odbcinst1", for example.
Avatar of DJ_AM_Juicebox

ASKER

hmm I don't understand - inside that same folder I have the following files:

    libodbcinst.so
    libodbcinst.la
    libodbcinst.so.1
    libodbcinst.so.1.0.0

is it trying to look for one of those, or something else?

Yes, right ;)
You'll have to add that directory to the environment variable LD_LIBRARY_PATH or copy them to some system-library-path (/usr/local/lib e.g., see /etc/ld.so.conf)

ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
They are all already in /usr/local/lib

shouldn't it be able to find whatever it needs in there then?
I depends if /usr/local/lib is in the library search path. Try setting LD_LIBARY_PATH to it to see. It's not a permanent change so setting it will do no harm. When you log out and log back in it will reset. If that doesn't solve it then you probably don't have the correct (version of the) DSOs.
wow - that seemed to work (have been struggling with this for two days).

So I won't really be able to execute that command line statement when I deploy this executable for real - what are my options to embed something in the executable itself to make this work?

Thanks!
Ensure the libs are installed into the correct system library path... usually /usr/lib.
Also, in future if you can't figure out the exact library a program requires try the ldd command...

http://unixhelp.ed.ac.uk/CGI/man-cgi?ldd

E.g.

ldd a.out
        linux-gate.so.1 =>  (0xffffe000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x40029000)
        libm.so.6 => /lib/tls/libm.so.6 (0x4010e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40134000)
        libc.so.6 => /lib/tls/libc.so.6 (0x4013f000)
        /lib/ld-linux.so.2 (0x40000000)
just put /usr/local/lib in /etc/ld.so.conf and run ldconfig.
That should do.
I wouldn't suggest to put them in /usr/lib, because there should only reside libraries installed by the distribution-packetmanager.
>> just put /usr/local/lib in /etc/ld.so.conf and run ldconfig.

The questioner stated, "So I won't really be able to execute that command line statement when I deploy this executable "

This implies he can't "just put /usr/local/lib in /etc/ld.so.conf and run ldconfig"; hence I suggested /usr/lib!

The correct way to do this is to deploy it all as a proper package (e.g. rpm or deb) that will install all the libraries where they need to go (and remove them properly too).