Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 41. Fundamentals of Shared Libraries > Installing Shared Libraries

41.7. Installing Shared Libraries

In the examples up to now, we created a shared library in a user-private directory, and then used the LD_LIBRARY_PATH environment variable to ensure that the dynamic linker searched that directory. Both privileged and unprivileged users may use this technique. However, this technique should not be employed in production applications. More usually, a shared library and its associated symbolic links are installed in one of a number of standard library directories, in particular, one of the following:

  • /usr/lib, the directory in which most standard libraries are installed;

  • /lib, the directory into which libraries required during system startup should be installed (since, during system startup, /usr/lib may not be mounted yet);

  • /usr/local/lib, the directory into which nonstandard or experimental libraries should be installed (placing libraries in this directory is also useful if /usr/lib is a network mount shared among multiple systems and we want to install a library just for use on this system); or

  • one of the directories listed in /etc/ld.so.conf (described shortly).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint