error on using shared library

This is a discussion on error on using shared library within the Tech Board forums, part of the Community Boards category; I have a code that uses a shared library, however when I tried to run it, it gives me this ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    569

    error on using shared library

    I have a code that uses a shared library, however when I tried to run it, it gives me this error:

    cannot open shared object file: No such file or directory

    how do I fix this? my instructor said something about using

    setenv LD_LIBRARY_PATH .....

    but what should I put in the ..... is it the directory where the .so file is?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    Try
    echo $LD_LIBRARY_PATH
    to see what is setup already.

    It's a ; separated list, like the PATH variable itself.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Run "ldd <binaryname>" to get a dump of the libraries it's TRYING to find. It will show which one it cannot find -- now go find that library and add its location to LD_LIBRARY_PATH.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. shared library for QNX
    By ReeV in forum C Programming
    Replies: 3
    Last Post: 05-06-2009, 10:58 AM
  2. Shared library design problem
    By p1r0 in forum C++ Programming
    Replies: 9
    Last Post: 03-23-2009, 12:36 PM
  3. Problems using/creating a shared library
    By benshi in forum C++ Programming
    Replies: 2
    Last Post: 05-13-2008, 02:27 PM
  4. Global variable in shared library
    By krock923 in forum C Programming
    Replies: 5
    Last Post: 01-11-2008, 03:56 PM
  5. Problem calling external method from within a shared library
    By Major Tom in forum C++ Programming
    Replies: 0
    Last Post: 04-21-2007, 09:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21