Installing mingw/msys with FreeGlut and Glew
I was trying to set up mingw/msys with freeglut and Glew, to be able to do some programming in OpenGL. None of the instructions I found seemed to be just right, so I’ve tried to document the steps I needed to get it to work.
Get the latest mingw-get-inst from SourceForge (tested with mingw-get-inst-20120426):
Run it, and install all the packages.
Some more info here: http://mingw.org/wiki/Getting_Started
Download the source for freeglut here:
http://freeglut.sourceforge.net/index.php#download (tested with 2.8.1)
Open up an msys shell window. Unpack freeglut, and configure, build and install with the following commands:
./configure --with-x=no --prefix=/mingw make make install
Download the source from Glew (tested with 1.9.0):
Unpack in the msys shell, and build and install with the following commands:
make make GLEW_DEST=/mingw install
That should have you up and running.
Some tutorials and stuff will tell you to link against library names that’s not quite right in mingw.
I built the first example from here: http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction
with the following command:
g++ triangle.c -lglut -lglew32 -lopengl32 -o triangle
Hope this is of any use.