Find the answer to your Linux question:
Results 1 to 4 of 4
This should be a really simple problem to fix, but I can't seem to figure it out. When I compile libraries, for example giblib, they install to /usr/local/lib/ Unfortunately, when ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Location
    New England
    Posts
    6

    Unable to find libraries


    This should be a really simple problem to fix, but I can't seem to figure it out.

    When I compile libraries, for example giblib, they install to /usr/local/lib/
    Unfortunately, when I try to compile programs which rely on those libraries, they seem unable to recognize that they exist.

    My current solution has been to simply copy the libraries from /usr/local/lib to /lib/ by hand, but that is a rather stupid solution, and there must be a better way, right?

    Help would be appreciated.
    Thanks in advance.

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    You can compile libraries into /usr/lib by doing
    Code:
    ./configure --prefix=/usr
    If the libraries are already in /usr/local/lib, you can do
    Code:
    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
    before you ./configure a package.

  3. #3
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    Add /usr/local/lib to /etc/ld.so.conf
    Ensure that the above command with PKG_CONFIG_PATH is run in .profile or .bashrc or something
    You may have to run ldconfig sometimes if a lib isn't recognized right away

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2008
    Location
    New England
    Posts
    6
    Adding it to PKG_CONFIG_PATH worked perfectly.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •