Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.