Is it possible to compile and run OpenGL programs from under Cygwin? If yes, how?
It is possible to compile and run OpenGL programs under Cygwin. I illustrate the basic steps here:
I assume you know OpenGL programming. If not, get the Red Book (The OpenGL Programming Guide). It is mandatory reading for OpenGL anyway.
I assume you have Cygwin installed. If not, visit cygwin.com and install it.
To compile and run OpenGL programs, you need the Cygwin package named opengl. In the Cygwin installer, it can be found under the Graphics section. Please install this package.
Write a simple OpenGL program, say ogl.c.
Compile the program using the flags -lglut32 -lglu32 -lopengl32. (This links your program with the GLUT, GLU and OpenGL libraries. An OpenGL program might typically use functions from all the 3 of them.) For example:
$ gcc ogl.c -lglut32 -lglu32 -lopengl32
Run the program. It's as simple as that!
If the above doesn't work (and it didn't for me), try the following (which did!)
gcc ogl.c -lglut -lglu -lgl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With