MinGW

From HotDec

Jump to: navigation, search

MinGW is a Minimal GNU environment for Windows. It consists of all the necessary GNU system tools (MSYS) and a Windows port of the GCC compiler. MinGW produces (fairly) POSIX compliant programs that run natively on windows.

Installing MinGW

  1. Download MSYS.exe and MinGW.exe (currently using MinGW-5.0.2.exe under "Proposed") from MinGW Downloads
  2. Install MSYS (the path to the base folder cannot have spaces, I suggest C:/MSYS/)
  3. Install MinGW (C:/MSYS/mingw/ if you don't want to mess with /etc/fstab). When asked, select these:
    • MinGW base tools
    • g++ compiler
    • MinGW Make
  4. (Optional) Install MinGW gdb
  5. (Optional)If you want ssh or some of the other common developer tools, download the msysDTK. This package includes: autoconf, automake, libtool, autogen, guile, cvs, openssl, openssh, inetutils and perl.
  6. (Optional) To enable 'gvim' from the command-line, color 'ls', and a personal bin folder, edit "/etc/profile" to include:
     alias gvim='/d/Windows/Program\ Files/Vim/vim64/gvim.exe'
     alias ls="ls -F --color"
     PATH=$PATH:$HOME/bin
  7. (Optional) To bind MSYS to "Ctrl + Alt + N", go into the shortcut properties and specify the shortcut key. (The shortcut may need to be on the desktop to work.)


Using MinGW from DOS

This doesn't seem useful at first, but it's necessary to use MinGW with other programs (like Eclipse). You will need to add the bin folders (e.g. C:/MSYS/bin/ and C:/MSYS/mingw/bin/) to the "Path" system variable. Here's how:

Start->Control Panel->Performance and Maintenance->System
Advanced->Environment Variables
Under "System Variables" select "Path" and press the Edit button
Add the /bin folders (seperated by semicolons) at the end of the variable value