Printer-friendly version
warning: Creating default object from empty value in /var/www/drupal/6.x/drupal-6.26/modules/taxonomy/taxonomy.pages.inc on line 33.

HOWTO Build MinGW as a Cross Compiler for Win32 Development on GNU Linux (Obsolete Information)

Minimalist GNU for Win32 (updated for MinGW gcc 3.4.5)


Much of the information presented on this page is obsolete; updated information may be found here.

HOWTO Use Mark J. Kilgard's OpenGL Utility Toolkit (GLUT) with MinGW

  • Download the binary and unpack the binary distribution of Nate Robins' Win32 port of GLUT. These instructions are based on version 3.7.6 and may not work with earlier or newer versions.
  • Create a subdirectory called GL in your project's include directory, and copy the file =glut.h= from the package there.
  • Copy the library, glut32.lib, to your project's build directory.
  • Copy the DLL, glut32.dll, to the same directory where your project's executable will be created.

pthreads library

Pthreads is part of POSIX and Windows isn't a POSIX system. However, there is a third party library on sourceware.org named pthreads-win32. Sourceware.org provides its own lists and MinGW does not support it but you are free to use it with MinGW at your own risk.

HOWTO Use the GCC specs file

About Specs file

The "gcc" program invoked by users is a convenient front-end driver executable which will invoke other programs in the background such as cc1, as or ld to do its work according to the command line parameter given. A specs file is plain text used to control the default behavior for the "gcc" front-end. The specs file is usually built-in but for flexibility purposes, it can be overridden with an external version. Example use: link against a different version of msvcrt.dll.

HOWTO Install the MinGW (GCC) Compiler Suite

Automated Installer

If you are new to MinGW, see the MinGW Getting Started instructions to use the automated GUI or manual CLI (Command Line Interface) installers. What follows below are instructions for a very "manual" download, typically only attempted by more experienced users.


MinGW ("Minimalistic GNU for Windows") is a collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs.

Getting Started

MinGW Installation Notes

MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we strongly recommend that you do not install MinGW in any location with spaces in the path name reference. You should avoid installing into any directory or subdirectory having names like "Program Files" or "My Documents", etc.

No version numbering convention exists for MinGW as a whole. Each package has its own version number, and the installer version number does not correlate, in any way, with the version number of any individual package which it installs.

The preferred installation target directory is C:\MinGW

The preferred installation method is using the automated installer tool, as described below. While a manual installation is possible, we do not recommend it, unless you have a very old version of MS-Windows which is unable to run the graphical tool. Instructions for manual installation are provided below, if you really want (or need) to resort to it.

After installation you will need to perform some additional tasks yourself to ensure your MinGW applications will run. Most importantly, you will need to make changes to your PATH environment variable. Be careful: there are two PATH variables which can be changed, and changing the wrong one can have significant consequences. Instructions for changing the correct PATH variable are provided below.

You will also need to ensure you specify the correct installation target directory to the MinGW environment. While it is possible to install MinGW to a location other than C:\MinGW (e.g. on a different drive), you must ensure that the MinGW environment knows where it is located. Instructions for doing this are also provided below.

Site Status

Site maintenance performed successfully, site online Dec 13th 12:00 AM Eastern.