Homebrew installed libraries, how do I use them?

I'm a bit confused.

I've installed a bunch of libraries (e.g. vtk, gsl,...) that I need for a c++ project for school. I used homebrew to install them (luckily there were formulas available).

My question is, does Homebrew link these into /usr/include or something comparable? Or is this something I would need to do manually?

Homebrew usually does this kind of stuff for executables, yet I can't seem the find the libraries anywhere other than in the /usr/local/Cellar/... directories. I have a bunch of libraries installed so I can't simply use -L/... for each of them.


They are usually linked in /usr/local/lib. If they are not there, try brew link <library-you-are-installing>; that should solve it.


For recent versions of Homebrew, installed libraries (for example, SDL) will be located in $(brew --prefix)/lib as symlinks. You can update the LIBRARY_PATH variable to use this location like so:

export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"

The headers files will similarly available in $(brew --prefix)/include so you can add this to your include directories.