Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded and built a C, g++ library that I want to use in a couple of other C projects.

What is the best/standard directory to put the library in on OS X Snow Leopard?

  • /opt/local/lib/
  • /usr/local/lib/
  • any other?

And related: What is the standard library/include search path for g++?

share|improve this question
up vote 2 down vote accepted

/usr/local/lib is the standard place for these in almost any Unix-like OS.

MacPorts creates the /opt hierarchy so that it doesn't mess with what you've done manually in /usr/local/.

Fink creates the /sw hierarchy for similar reasons.

Homebrew I think still defaults to messing with /usr/local (a design decision I find distasteful), but I think it has a "prefix" option to make it use its own hierarchy instead.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .