APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > FAQ > I get an error message 'Can't access shared library'
Printer Friendly Version




SCO Unix ® FAQ section

Unix, Xenix and ODT General FAQ



This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

I get an error message "Can't access shared library"



Bela Lubkin posted the following to comp.unix.sco.misc in response to someone getting this message on a 3.2v4.2 system:

Well, that's a _good_ sign -- it proves you have a COFF binary, which at least has a _chance_ of working under 3.2v4.2. If it was an ELF binary you would get something like "cannot execute".

You can query the shared libraries needed by a COFF binary. Run:

 
   dump -Lv Mosaic
 

dump(CP) is part of the development system. If you don't have it, you can do a crude simulation by running:

 
   strings Mosaic | grep /shlib
 

Compare the output to the actual contents of your /shlib directory. You'll find one or more libraries either missing, or with wrong permissions. If it's just a permissions problem, fix it; if a library is missing, ask about it here, people will know where to find it.

On OpenServer 5, which runs both COFF and ELF binaries, both `dump` and `ldd` are useful:

 
 ### shows _both_ COFF and ELF shared objects; only choice for COFF:
 # dump -Lv binary       # optional:    | grep /    -- eliminate noise
 
 ### only works on ELF; knows about UDK runtime; best choice for ELF;
 ### but aborts after one missing library, so `dump -Lv` also useful:
 # ldd binary
 
 ### example 1: OpenServer ELF binary with both ELF and COFF shared objects
 # file /usr/bin/rcp
 /usr/bin/rcp:   ELF 32-bit LSB executable 80386, dynamically linked, stripped, no debug
 # dump -Lv /usr/bin/rcp | grep /
 /usr/bin/rcp:
 [1]     NEEDED   /usr/lib/libndbm.so
 [2]     NEEDED   /usr/lib/libsocket.so.1
 [3]     NEEDED   /usr/lib/libc.so.1
 /usr/bin/rcp:
         /shlib/libkrb5stand_s
 # ldd /usr/bin/rcp
 dynamic linker: /usr/bin/rcp: file loaded: /usr/lib/libndbm.so
 dynamic linker: /usr/bin/rcp: file loaded: /usr/lib/libsocket.so.1
 dynamic linker: /usr/bin/rcp: file loaded: /usr/lib/libc.so.1
 # mv /usr/lib/libndbm.so /usr/lib/libndbm.missing; ldd /usr/bin/rcp
 dynamic linker : /usr/bin/rcp : error opening /usr/lib/libndbm.so
 # mv /usr/lib/libndbm.missing /usr/lib/libndbm.so
 
 ### example 2: UnixWare ELF binary
 # file /udk/bin/uname
 /udk/bin/uname:  ELF 32-bit LSB executable 80386, dynamically linked, stripped, no
 debug (unixware)
 # dump -Lv /udk/bin/uname | grep /
 /udk/bin/uname:
 [1]     NEEDED   /usr/lib/libc.so.1
 # ldd /udk/bin/uname
 /udk/bin/uname needs:
         /usr/lib/libc.so.1 => /udk/usr/lib/libc.so.1
 
 ### example 3: COFF binary
 # file /u/belal/bin/Csum
 /u/belal/bin/Csum:      iAPX 386 COFF demand-paged executable
 # ldd /u/belal/bin/Csum
 ldd: /u/belal/bin/Csum is not an ELF file
 # dump -Lv /u/belal/bin/Csum | grep /
 /u/belal/bin/Csum:
 /u/belal/bin/Csum:
         /shlib/libc_s
 
If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide




 I sell and support
 Kerio Mail server
g_face.jpg

This post tagged:

       - FAQ




Unix/Linux Consultants

Skills Tests

Guest Post Here