Step 1: Install GLFW 3 on your system using CMAKE
For this installation, I used KUbuntu 13.04, 64bit.
The first step is to download the latest version (assuming future versions will work in a similar way) from www.glfw.org, possibly using this link .
The next step will be to extract the archive and open the terminal. cd into the glfw-3.XX directory and run cmake -G "Unix Makefiles" , you may need elevated privileges, and you may also need to install build dependencies first . To do this, try sudo apt-get build-dep glfw or sudo apt-get build-dep glfw3 or do it manually since I used sudo apt-get install cmake xorg-dev libglu1-mesa-dev ... be other libraries, which you need, for example, with the pthread libraries ... Apparently, I already had them. (See the -l options specified in the g ++ build phase below).
Now you can type make and then make install , which will probably require sudo first.
Well, you need to get detailed output in the last three stages of CMake, telling you what was built or where it was placed. (In /usr/include , for example.)
Step 2. Create a test program and compile
The next step is to run vim ("what ?! vim ?!" you say) or your preferred IDE / text editor ... I didnβt use vim, I used Kate, because I'm on KUbuntu 13.04 ... Anyway, download or copy the test program from here (at the bottom of the page) and save, exit.
Now compile with g++ -std=c++11 -c main.cpp - not sure if C ++ 11 is required , but I used nullptr , so I need it ... You might need to upgrade gcc to version 4.7, or the upcoming version 4.8 ... Information on this is here .
Then correct your mistakes if you typed the program manually or tried to be "too smart", but something didnβt work ... Then connect it using this monster! g++ main.o -o main.exec -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi So, you can see that in the section "Dependencies for installing the assembly" you can also check that you have GL, GLU , X11 Xxf86vm (whatever it is) Xrandr posix-thread and Xi (whatever it is) development libraries . Perhaps update your graphics drivers, I think GLFW 3 may require OpenGL version 3 or higher? Maybe someone can confirm this? You may also need to add linker options -ldl -lXinerama -lXcursor to make it work correctly if you get undefined dlclose (credit for @ user2255242).
And yes, I really need many -l s!
Step 3: You are done, had a good day!
I hope this information was correct and everything worked for you, and you enjoyed writing the GLFW test program. Also, I hope this guide has helped, or will help, several people in the future who have fought, as they did yesterday!
By the way, all tags are those things that I searched on stackoverflow, looking for an answer that was not there. (Until now.) I hope this is what you were looking for if you were in a similar position for me.