[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

where to place library files under linux

Hi,

Is there any common place you put libraries used for developing apps under linux? When developing for win32, I  usually make a folder under C:\ called "lib". Then all users can access any library under c:\lib.

Under linux, it seems there's already a folder called "lib". Is it proper to dump my libraries into there, or should I create some separate folder to differentiate? Also, it looks like in the /usr folder on my system we have a copy of the lib folder - what is the purpose of having /lib, and then usr/lib?

Thanks
0
DJ_AM_Juicebox
Asked:
DJ_AM_Juicebox
  • 2
1 Solution
 
jkrCommented:
Under Linux, that's quite similar - it *is* '/usr/lib', as you assumed above. http://www.tldp.org/HOWTO/Program-Library-HOWTO/index.html ("Program Library HOWTO") adresses that also, I already mentioned that HOWTO in an earlier question of yours.
0
 
jkrCommented:
BTW, to reference a particular library that is not placed there, use

-L/path/to/other/lib

to specify that directory on teh compiler's/linker's command line. As the man page says:

      -Ldir  Add  directory dir to the list of directories to be
             searched for `-l'.

      -llibrary
             Use the library named library when linking.

             The  linker searches a standard list of directories
             for the library, which is  actually  a  file  named
             `liblibrary.a'.   The linker then uses this file as
             if it had been specified precisely by name.

             The directories searched include  several  standard
             system  directories  plus any that you specify with
             `-L'.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now