Where do I put self built libraries on OS X?

1

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++?

RickyA

Posted 2011-07-15T08:03:11.057

Reputation: 171

Answers

2

/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.

Spiff

Posted 2011-07-15T08:03:11.057

Reputation: 84 656