how to

Printer-friendly version

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

  1. Be sure you really need to build an [MSYS Application | Shells, terminals and MSYS] rather than just a Windows Application.
  1. 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.

  1. ~__CYGWIN~__:

MinGW for First Time Users HOWTO

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

First you must make sure you have installed MinGW and set the System Variable for Path is set to express the location of MinGW. This is explained Here.

Now, assuming your directory for MinGW is the default C:\MinGW, and your Environment Variable is set to C:\MinGW\bin, it is easy to start compiling a C++ 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.

MinGW cross compiler for Linux build environment

Page updated to current status, as of 15-September-2008.

Previous content of this page was confused, misleading and obsolete. Nevertheless, if you wish to refer to this older content, you may find it here.

HOWTO Submit Patches to Correct MinGW Bugs or to Add MinGW Features

You've identified a bug in a MinGW package, and you've developed a solution to correct the defect. So, how do you submit that solution, for inclusion in MinGW?

All user proposed modifications or enhancements to MinGW are subject to review and approval by the project administrators, and the project development team. By following the guidelines set out below, you will give your solution its best chance of being adopted, in a timely fashion.