I will suggest installing glfw via homebrew http://brew.sh/ The advantage being you can always uninstall it neatly by doing brew uninstall glfw3
!
You need to have the "Command Line Tools for Xcode" and Xcode install https://github.com/Homebrew/homebrew/wiki/Installation
xcode-select --install
Once Homebrew is installed, open the terminal and run
brew update
brew tap homebrew/versions
brew install glfw3
for glfw3 OR
brew install glfw2
for glfw2
Also, if you desire an static build, use the flag --static
brew install --static glfw3
The libraries and include files will be available at usr/local/lib
and usr/local/include
Now, if you have a program that relies in opengl and glfw, you'd want to compile it something like this: gcc program.c -o myapp -framework OpenGl -lglfw3
(or -lglfw2)
If you still have some problems with the glfw header file, you can do:
gcc program.c -o myapp -framework OpenGl -I/usr/local/include -lglfw3
You most likely need to link in a few of OS X's frameworks, according to GLFW's docs, adding
-lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo