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:

Download the source for freeglut here: (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 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 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:

with the following command:

g++ triangle.c -lglut -lglew32 -lopengl32 -o triangle

Hope this is of any use.

3 thoughts on “Installing mingw/msys with FreeGlut and Glew

  1. Estian

    Hi there! I’ve been stumbling blindly from forum to forum for the past 4 hours trying to find out how to do what you describe here but alas it has been to no avail. Could you please be more specific on the use of the msys shell for the freeglut part of the process? I have never used it before and can’t seem to get it to find any form of directory from which I can navigate into the unpacked freeglut folder. Also should I be unpacking freeglut using the msys shell or not? If so, how do I go about doing that? Thanks in advance, hopefully you can help

    1. Greger

      I unpack in the msys shell.
      You can unpack a tar.gz-archive with tar.
      Using a command in the likes of tar -zxvf filename.tar.gz

      If you downloaded freeglut-2.8.1.tar.gz in e.g. c:\users\foo\downloads\, you could unpack it from the shell with:
      tar -zxvf /c/users/foo/downloads/freeglut-2.8.1.tar.gz

  2. Ruben Garcia

    Tested with glew 1.12.0

    make returns

    /usr/bin/uname -p = unknown

    Makefile:40: *** “Platform ´´ not supported”. Stop


Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.