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):
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/

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):

http://glew.sourceforge.net/

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.

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

     
    Reply
    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

       
      Reply
  2. Ruben Garcia

    Tested with glew 1.12.0

    make returns

    /usr/bin/uname -p = unknown

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

     
    Reply

Leave a Reply

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


*