LoginSignup
1
2

More than 5 years have passed since last update.

homebrewでGLFWを入れてコマンドラインで実行するまで

Posted at

OpenGLの参考書でGLFWを使うのだが、実行するまでにつまづいたのでメモ。

まずはhomebrewでglfwをインストールする。

$ brew install glfw

GLFWのサイトからサンプルコードを持ってきて、sample.cとして保存する。
GLFW - Documentation

作成したsample.cをコンパイルする。

$ clang sample.c -o sample -framework OpenGL -I/usr/local/include -L/usr/local/lib -lgfw

実行ファイルを動かしてみる。

$ ./sample
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2