how to

Printer-friendly version

HOWTO Set the HOME variable for cmd exe

Set the HOME variable

The HOME variable is one of the essential variables required by *NIX systems. It is already set in an MSYS environment, but not in a cmd.exe environment. Some applications, e.g. vim.exe, may behave erroneously or even crash if this variable is missing. In order to use these application from cmd.exe, it is thus required to set the HOME variable in the cmd.exe environment as well.

HOWTO compile and use the mpatrol memory leak detection library

1. Download the latest MinGW automated Installer from:
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/

2. Run it, select Download latest repository catalogues, then select all components to be installed (you need C and C++ compilers, if you want you can leave out the other three - Fortran, ObjC, Ada)

3. Once MinGW is installed download the autotooled mpatrol version (we have it thanks to Vincent Torri) either from the SVN repository via an SVN client:
https://mpatrol.svn.sourceforge.net/svnroot/mpatrol/branches/AUTOTOOL

HOWTO Specify the Location of Libraries for use with MinGW

FIXME: Page under construction; some value here now, but not yet complete.

I will add to this as time permits; please bear with me. My intent is to offer advice, complementing the information relating to include file search paths, on circumventing the limitations of MinGW's GCC when installing, and subsequently linking with, user added function libraries.

HOWTO Build an MSYS Application

TODO: Convert to MediaWiki syntax

Building an MSYS Application

  • Be sure you really need to build an MSYS Application rather than just a Windows Application.
  • config.guess and config.sub:

The first change you'll need to make is to the config.guess and config.sub unless you've obtained the source from the msys/packages CVS repository. That repository will have the changes already accomplished. Changing these files is a simple as copying the Cygwin sections and changing CYGWIN and cygwin to MSYS and msys respectfully.

  • __CYGWIN__:

MinGW for First Time Users HOWTO

For those who are just starting out, this will explain how to use MinGW to compile an executable, from C or C++ source, in a command prompt environment.

First you must make sure you have installed MinGW and set the PATH environment variable include the location of MinGW;
this is explained Here.

Now, assuming your directory for MinGW is the default "C:\MinGW", and your PATH environment variable is set to include "C:\MinGW\bin", it is easy to start compiling an executable:

HOWTO Specify the Header File Include Path for use with MinGW Compilers

FIXME: Page under construction; mostly complete now, but may need some clarifications.

I will add to this as time permits; please bear with me. My intent is to provide answers to some remarkably similar, but independently asked, questions which have appeared recently, on the MinGW-Users and MinGW-MSYS lists.


Introduction

This Mini-HOWTO attempts to answer the FAQ: "Why can't the MinGW compilers find my project's header files?"

Build a MinGW Hosted Cross Compiler for Other Platforms

 

TODO: Formatting -- I think I (Keith) got it right; please fix any errors.

FIXME: Software versions described are outdated; please update as appropriate, for current versions.

Building a MinGW Hosted Cross Compiler

To compile and link executables for an embedded target under windows you require a cross compiler for your required processor. This is almost as easy with a properly configured MSYS/MinGW installation as it is with a GNU/Linux machine, merely requiring a few patches for some things that aren't available in a windows native environment.

Large executables

Reasons for 'large' objects, libraries and executables

Debugging Information

The most common reason why executables are larger than expected is that they include debugging information, which is generated when source files are compiled with the "-g" option to GCC. Even when your own source files are compiled without debugging information, libraries linked with your executable may have been compiled with "-g" (possibly including system libraries that are distributed with MinGW).

Use more recent defined functions

 

  • When compiling, the compiler doesn't seem to find the correct definitions for a specific Windows version or a specific Internet Explorer version. Why is that?
    • You need to set defines _WIN32_WINDOWS, _WIN32_WINNT, WINVER and/or _WIN32_IE to the minimum platform you plan to support before including the windows.h header file. Possible values for these definitions can be found in the header w32api.h file.

Compile with gcj

When you first download and install the MinGW Java compiler (gcc-java), you may find that when you try to compile a Java program with gcj, you get an error saying "cannot find -liconv". This is because gcj automatically attempts to link your program with libiconv, which is not distributed with MinGW and must be downloaded and installed separately. To get your Java program to compile, download libiconv from http://gnuwin32.sourceforge.net/packages/libiconv.htm. You want "Binaries" and "Developer files". Unzip both downloaded files to your MinGW directory.

Site Status

Site maintenance completed May 25th, 2012 at 12:38 UTC