I found this nice video tutorial at Youtube video:
https://www.youtube.com/watch?v=WjSRCX4OrZU
Then I downloaded the example from: https://bitbucket.org/c-code/snakegame/src/master/opengl_cube.c
but when I tried to compile I got this error:
$ gcc opengl_cube.c -o cube -lgl -lglu/usr/bin/ld: cannot find -lgl: No such file or directory/usr/bin/ld: cannot find -lglu: No such file or directorycollect2: error: ld returned 1 exit status
So, the solution was installing these packages:
$ sudo apt install build-essential libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
Then I noticed my other mistake, it should be -lGL and -lGLU, also -lglu was needed:
$ gcc opengl_cube.c -o cube -lGL -lGLU -lglut