john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

mingw msys compile open source code on windows

  1. download MinGW web based installer the 130kb file will give you a menu to choose what "components", I chose all base mingw and make which is the core gcc compiler components and utils.

then it downloads a bunch of .tar.gz on your desktop and then it extracts them all to c:\MinGW

After it's done, verify that c:\MinGW has all of the folders\bin .exe files, then you can delete the installer.exe and .tar.gz files from your download location.

  1. Next download and install MSYS (default location C:\msys\1.0 ), the Linux/Unix GNU utilities that are unavailable in windows but often required by open source software to "build from source"

e.g. ./configure

The end of MSYS installation queries where your MinGW is installed, you should (case sensitive) give it C:\MinGW

(this ensures that any /bin/make.exe from before won't interfere with the MSYS make utility)

  1. Start a MSYS shell (which opens up the familiar $ bash prompt) by using the desktop shortcut or Start -> All Programs -> MinGW -> MSYS -> MSYS

Because you are starting in your "home" directory of ~, Change Directory to the root of your MSYS and List what directories/files are available:

cd / ls

bin doc etc home m.ico mingw ...

Display what has already been "mounted" from your Windows Folders:

mount

C:\msys\1.0 on / type user (binmode,noumount) C:\MinGW on /mingw type user (binmode)

IF YOU DON'T SEE that association between c:\mingw and /mingw you should use notepad to edit the C:\msys\1.0\etc\fstab file to look like the following:

C:\MinGW /mingw mingw c:\mingw

Then exit and restart

  1. Use Windows Explorer to copy your .tar.gz file into c:\msys\1.0 (this imports it into the MSYS directories)

  2. In your shell run the command to extract files to a directory tar -xzvf filename.tar.gz

  3. change to the newly extracted directory cd directoryname

  4. ./configure

    this will do all sorts of automated checks of your GCC build/compile environment, it will hopefully finish successfully, my last two lines were: config.status: executing depfiles commands config.status: executing libtool commands

  5. make

    this generates a load of crazy messages - bad news if you see Error 1

    very often you will run into trouble at ./configure and make as a lot of source code is actually written requiring system dependent headers...

  6. make install


  • « cmu sphinx 4 java on windows
  • file read conf file »

Published

Aug 8, 2010

Category

c-programming-guides

~364 words

Tags

  • c-programming-guides 25
  • code 7
  • compile 2
  • mingw 1
  • msys 1
  • on 26
  • open 6
  • source 9
  • windows 72