Thread: problem in changing shared library path in linux

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    1

    problem in changing shared library path in linux

    Hi all,

    Please help me to solve this problem.

    I want to change the default shared library path (/usr/lib/) iin my power pc linux. I dont have ldconfig command support. Please give me some other solution to do that.

    Thanks in Advance

    Remya

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    What you are asking to do is not easy. This involves REBUILDING YOUR ENTIRE SYSTEM. Many of the programs built on the system expect that, at least, the libc library is located under a specific location (usually /usr/lib). To change this, you'd need to build a new system making sure to set the path variable in ./configure to wherever you wanted it. Next, download all the source packages and recompile _ALL_ your software as the ones on your system will not work with the new library path.

    So, what I'm saying is your question was not specific enough. Please explain what you are attempting to do.

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Kennedy View Post
    What you are asking to do is not easy. This involves REBUILDING YOUR ENTIRE SYSTEM. Many of the programs built on the system expect that, at least, the libc library is located under a specific location (usually /usr/lib). To change this, you'd need to build a new system making sure to set the path variable in ./configure to wherever you wanted it.
    That's not true. Generally, the paths used in configure are to determine where to put things after the build. Runtime linking is done by the runtime linker, ld.so. The library path is not hardcoded by programs -- or at least, not normally (and it should not be).

    You can add to and remove paths used by the runtime linker with ldconfig, which evidentally the OP has heard of this. ldconfig is part of the glibc package, so at one time or another it must have been installed. It is also required just to install a normal distro package, so it would be very strange if it were "not available".
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by MK27 View Post
    That's not true. Generally, the paths used in configure are to determine where to put things after the build. Runtime linking is done by the runtime linker, ld.so. The library path is not hardcoded by programs -- or at least, not normally (and it should not be).

    You can add to and remove paths used by the runtime linker with ldconfig, which evidentally the OP has heard of this. ldconfig is part of the glibc package, so at one time or another it must have been installed. It is also required just to install a normal distro package, so it would be very strange if it were "not available".
    MK27: Try this: Move the file /lib/libc.so.6 to /usr/lib. BUT, make sure you have a way to reboot your system and move it back. BTW, that file is "only" a sym link. Let me know if it works.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Buidl Library with ./configure script
    By Jardon in forum C Programming
    Replies: 6
    Last Post: 07-24-2009, 09:36 AM
  2. Problems using/creating a shared library
    By benshi in forum C++ Programming
    Replies: 2
    Last Post: 05-13-2008, 02:27 PM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. 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
  5. wxWidgets loading shared library problem
    By BobS0327 in forum Linux Programming
    Replies: 1
    Last Post: 05-10-2006, 07:23 PM