brew install glfw3

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值