Thursday, 30 January 2014

glfw v3 on Debian/Mint/Ubuntu

This is a post just for me really, but if it helps others, so be it...

Installing glfw on Linux (Mint/Ubuntu/Debian)... My steps...

sudo apt-get install libx11-dev libgl1-mesa-dev libglu1-mesa-dev -libxrandr-dev libxext-dev
sudo apt-get install cmake xorg-dev

Download glfw code, and extract... Move to that folder...

sudo cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX=/usr
sudo make
sudo make install

Then lets say we want to build the "boing" example, move to the examples folder with the boing.c file...

gcc -Wall -g -c ./boing.c -o obj/boing.o
g++ -o bin/Boing obj/boing.o -lGLU -lGL -lm -lX11 -lpthread -lXxf86vm -lglfw

So in Code::Blocks, your linker settings look like this for a glfw project:


No comments:

Post a Comment