I can't find the answer to my question here; what can I do now?
The MinGW Project runs two mailing lists, to which you are encouraged to subscribe:
MinGW-Users List for questions related to using, installing or configuring the MinGW compiler suite.
MinGW-MSYS List for questions relating to MSYS.If you can't find an answer here, or by searching the archives of these lists, then please subscribe and ask.
I notice there is also a MinGW-Dvlpr list; can I use this to pose questions directly to the MinGW Developers?
NO! The MinGW-Dvlpr List is a private list, for discussion among bona-fide MinGW Developers only. The only way to join this list is to apply to become a MinGW Developer; we always refuse direct subscription requests to this list.
What about the other lists you manage?
These are mostly special purpose lists, of limited interest to general users. You are welcome to review their respective list information pages, if you think any may be of interest; however, you should consider these lists to be read-only, and never direct any mail to them.
When I send mail to the MinGW mailing list, my posts are rejected.
Have you subscribed to the list, to which you are trying to post? Are you posting from the address you subscribed? To avoid SPAM, the mailing list accepts incoming messages from subscribed users only, and only from the address which they have specified when they subscribe. Please read more here.
When I look for information on the MinGW website, it appears to be hopelessly out of date.
This is particularly true of the downloads page.
We used to have a website maintainer, but he is no longer active. We are exploring solutions, to hopefully improve the situation, but in the meantime, the website remains, regrettably, unmaintained. Much of the information presented there is stale.
The downloads page is a particular case in point. That used to be automatically updated, by means of a script running at four hourly intervals; (it was never hourly, as the page mistakenly claims). The update script relied on information appearing in a particular format on the main
SourceForge Download Page. SourceForge redesigned that page layout; we updated the script to suit. SourceForge immediately changed the design again. We got tired of chasing the moving target. The download page at
http://www.mingw.org/download.shtml is no longer kept up to date; it may suggest otherwise, but it "speaks with forked tongue". Please ignore it, and go directly to the project download page at
https://sourceforge.net/project/showfiles.php?group_id=2435 instead.
How do I copy and paste text, in an MSYS console?
The default rxvt font size is too small. How do I enlarge it?
Why don't the Home and End keys work in rxvt and vim?
Using WinZip, the files contained in my tar file are converted from LF to CR/LF. How can I avoid this?
Make sure that you first uncheck the "TAR file smart CR/LF conversion" checkbox found in the Configuration -> Miscellaneous tab of the Options menu of WinZip
Can I use older versions?
It's highly recommended that you use the latest version of MinGW. Older versions may have more bugs and can be more difficult to install or use than the latest version. Please be sure that you have downloaded and are working with the latest version, especially if you are having any difficulties with installation or use. If you are not sure of your version, you can type gcc -v to find out what you are using.
Can I mix MSYS executables and other executables?
NO! Avoid that at all costs.
You may install the MinGW and MSYS packages anywhere on your filesystem, even nesting one within the other (creating a "mingw" subdirectory beneath your "msys" directory, for instance). However, it is important to remember that NO executables other than what ships with MSYS should be placed in the MSYS " bin" subdirectory. Therefore, do not attempt to "merge" the two packages.
Notice that the order of subdirectories in your PATH becomes significant after you add MSYS to Windows. The MSYS "bin" subdirectory redefines DOS command line verbs such as "find", if you place it in your PATH ahead of the %windir%\system32\ subdirectory.
I'm told I can't edit these pages. Why is that?
You must first choose a WikiWiki name for yourself, and sign in.
(Note that you may see some very weird error messages, if you choose an invalid WikiWiki name; it must start with a capital letter, end with a lower case letter, and have at least one other capital letter embedded. Every capital letter must be followed by at least one lower case letter; contiguous sequences of capital letters are not allowed).
Please read the section on how to edit MinGWiki Pages.
How and where do I report bugs?
Please follow the guidelines on this page: ReportBugs
How and where do I submit patches?
Please follow the guidelines on this page: SubmitPatches
I want to help! How do I join the party?
The Helping MinGW page contains all the information to help us.
How do I compile a Java program with gcj?
See the Compile with gcj HOWTO.
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 w32api.h file.
My executable is large and bloated after compilation. How can I avoid this?
The executables large page will teach you how to strip a binary and how to avoid large executables.
My executable is sometimes different, when I compile and recompile the same source. Is this normal?
Yes, by default, and by design, MinGW's GCC does not produce ConsistentOutput, unless you patch it.
Why do I get error messages when building a simple program using MinGW?
You might have partially installed MinGW: please read error messages.
Why does gcc give internal compiler error messages?
These might be internal compiler errors that aren't consistently reproducible due to hardware problems.
Why might compiling become mysteriously deadlocked?
Take a look at reports of mysterious deadlocks.
Why do I get "undefined reference" errors from the linker?
To avoid undefined references you must specify libraries in the right order on your command line.
How do I specify the libraries to be searched by the linker?
MinGW supports libraries named according to the `<name>.lib' and `<name>.dll' conventions, in addition to the normal `lib<name>.a' convention common on *nix systems. To include any libraries named according to any of these conventions, simply add the `-l<name>' switch to the compiler command, ensuring it is placed after the name of the module in which the reference appears.
Note that, if the library is not found in any of the default library search paths, you may also need to insert a `-L<dir>' switch before the `-l<name>' switch, to specify its location.
Also note that the library names `lib<name>.a' and `lib<name>.lib' are not equivalent; if you have a library named according to the aberrant `lib<name>.lib' convention, it will not be found by specifying the `-l<name>' switch -- you must use the form `-llib<name>' instead.
My program requires function foo().
I'm sure I'm specifying all the libraries correctly, and in the correct order, but I'm still getting undefined reference errors. What am I doing wrong?
Possibly nothing, other than perhaps misunderstanding MinGW philosophy. If you are porting a POSIX application, it is likely that it uses some POSIX functions which simply are not available on MS-Windows; (a common example is the fork() function). If this is the case, MinGW cannot help you, because it does not aspire to providing a full set of POSIX functions; (that would violate its "Minimalist" ethos; if it isn't provided by Microsoft, in MSVCRT or in any of the other DLLs which furnish the MS-Windows API, then you shouldn't expect it in MinGW).
For this situation, you have two basic alternatives:--
Why don't wide characters work with libstdc++?
The wide-character parts of the GCC Standard C++ Library (libstdc++) have not yet been fully ported to Windows. Alternatives and discussion on this can be found here.
How do I correctly use threads in MinGW?
You should use _beginthreadex instead of CreateThread for the reason cited on the threads page.
Why can't I mix objects from different compiler brands or mix objects from different compiler versions of the same compiler brands?
This issue is not specific to MinGW: many compilers are mutually incompatible.
How do I remove DOS command windows?
In the link step add a "-mwindows" switch to the command line.
Why does make often crash creating a sh.exe.stackdump file when I try to compile my source code?
If you experience random crashes with make as well as with the msysinfo command (i.e., repeating the command often allows to compile the source code successfully), the issue might be caused by the Logitech QuickCam software. Here is a possible solution to this problem:--
In this way the Logitech QuickCam daemon won't be available anymore. Nonetheless, the camera will keep working just ok with 3rd party software (e.g., Skype). If you want a less drastic solution, just kill the lvprcsrv.exe process whenever you want to use MSYS by typing at the command prompt:--
pskill -t lvprcsrv.exe (you will need PsTools and administrator privileges to do this). However, as soon as you will plug in the USB cable of your Logitech QuickCam, the daemon will be restarted, while with the first procedure it won't.
How do I build a Win32 cross-compiler to be hosted on Linux?
Historically, a number of approaches have been adopted. Some of these are described here; however, the information may be rather outdated and stale; (none of the advice offered there is any longer officially endorsed by the MinGW Developers).
Some Linux Distributors may offer pre-built MinGW binary packages, which may be installed using the distribution's favoured package manager. You may choose to simply use one of these. Do be aware, however, that these packages are neither endorsed nor officially supported by the MinGW Developers; if you do choose one of these distributions, and you encounter problems, then the MinGW Developers may decline to provide support, referring you instead to the appropriate Linux Distributor.
More recently, the MinGW Developers have created a package of interactive shell scripts, which will guide you through the process of downloading the source packages you require, then building and installing the cross-compiler suite. If you wish to have a cross-compiler which will be officially supported by the MinGW Developers, then you are encouraged to use these scripts, which may be found
here. These will create a cross-compiler which is compatible with the latest stable version of MinGW-GCC, (currently GCC-3.4.5), released by the MinGW Project, for native use on MS-Windows; as newer versions are declared stable for native use, it is intended that these cross-compiler build scripts will be updated accordingly. (Note that you require only the basic script package; the `devel' package is required only if you wish to assist the official maintainers in the development of the scripts).
How do I build a source package I just downloaded?
The package guide contains a list of packages along with a description of the package and a tutorial for compiling it.
I didn't modify any configure.in or makefile.in, but the build process still tries to regenerate these files. What should I do?
You can install automake? and autoconf? (by installing the msysDTK? package for example), or tell make not to regenerate these files by using this timestamp hack.
How do I create a DLL?
The sample DLL tutorial will teach you how to create and a use a DLL.
How do I create a DLL for Visual Basic to use?
The Visual Basic DLL tutorial will teach you how to create a DLL with MinGW and a use it with Visual Basic.
Where do I find a memory leak detector?
Wu Yongwei's memory leak detector can be found here :
http://wyw.dcweb.cn/leakage.htm
I've built an Open Source package, containing documentation in manpage format; how do I read it?
Manpages are a documentation format prevalent on UNIX systems, where a special program called "man" is normally used to read them.
There is currently no "man" program available for MinGW/MSYS, although one is under development; (you may
download a DevelopmentSnapshot?, if you are prepared to compile it yourself; see the
release notes for further information). In the meantime, you can use the "groff" program, available in
this mingwPORT, to read manpages. This program is actually used by the "man" program itself, running a command similar to:--
groff -Tascii -pet -mandoc -P-c <manpage-file> | less -irs
To make it more convenient to view manpages, Wu Yongwei and Keith Marshall have provided these scripts, which implement a rudimentary version of a "man" program, for use with MSYS, or in a cmd.exe window.
Note that you will still need to have "groff" installed, when the full "man" package becomes available, if you wish to use "man" for reading documentation in the manpage format.
How is MinGW licensed?
When Colin Peters released the MinGW runtime he placed the source into the public domain. No one owns a copyright (C) to the source because of this. You as a software manufacturer are free to use the MinGW runtime in your proprietary and open source? software as you see fit. The only thing you can't do is to claim ownership of the source and use Colin Peters' name, the MinGW name or the name of any of it's contributors in endorsement of any product.
Please view MinGW licensing for full details.
How is MSYS licensed?
From MSYS_LICENSE.rtf:
You may redistribute MSYS in part or in whole as long as you follow the guidelines of redistribution of each license contained within. To be certain that you are being legally compliant, always distribute the source. Distribution of source is your responsibility should you decide to redistribute MSYS. If you distribute MSYS via a web site then you must put a copy of the source for that version of MSYS on your web site as well. If you distribute MSYS via removable media then you must distribute that version of MSYS source with that same type of removable media.
Binaries created from the use of MSYS and of MinGW are not bound by any license found within this package unless you use a library that is itself covered by the GPL license. If you wish to create proprietary software then don't use libiberty.a or any other GPL licensed library. A library licensed with LGPL (Lesser GPL) may be used by proprietary software without GPL infection as special permission within the LGPL has given you this right.
So essentially unless you end up explicitly linking against msys-1.0.dll, programs built in MSYS shell using MSYS tools are not infected with GPL. Compiling and linking inside MSYS shell or using MSYS tools alone does not automatically link against the dll.
Please view MSYS_LICENSE.rtf for full license text.
What Languages Are Supported?
As of summer 2005, MinGW supports C, C++, ObjC, Fortran 77, Ada and Java. And last, but not least Pascal is available as a contributed package (GPC).
How do I use MinGW with Cygwin?
For those who would like to use the Cygwin environment for development, yet generate non-Cygwin-dependant executables, a much easier option to "-mno-cygwin" does exist. Simply install Cygwin and the MinGW distribution in separate directories (i.e. "C:\CYGWIN" and "C:\MINGW"), and make sure that the "/bin" subdirectory beneath your MinGW installation comes before Cygwin's "/bin" subdirectory in your PATH environment variable (i.e. "PATH=%PATH%;C:\MINGW\BIN;C:\CYGWIN\BIN"). This will allow you access to all the UNIX tools you want, while ensuring that the instance of GCC used is the MinGW version.
Bear in mind that within the "/etc/profile" file, Cygwin by default places "/usr/local/bin", "/usr/bin", and "/bin" ahead of your system-level PATH. Therefore, it is not enough to have the MinGW's "/bin" ahead of Cygwin in your Windows path... it must also be set to come first within the Cygwin environment (either by modifying "/etc/profile" or setting it manually).
Is support provided for COM?
MinGW has some support for COM programs. Programmers have had much better luck writing COM applications in C than C++. Work is in progress to improve support. Check the MinGW mailing list archives for more details on COM and more links to example files.
What's the difference between gcc and mingw32-gcc?
The mingw32-gcc, mingw32-g++, etc. binaries exist as an aid to cross development. They are created in a typical build of gcc. They are therefore distributed as the maintainers of GCC meant them to be. The gcc.exe indicates that the binary produces binaries for a target equal to the build, while the mingw32-gcc binary produces binaries to be executed on the mingw32 target.
What's the difference between make and mingw32-make?
The "native" (i.e.: MSVCRT? dependent) port of make is lacking in some functionality and has modified functionality due to the lack of POSIX on Win32. There also exists a version of make in the MSYS distribution that is dependent on the MSYS runtime. This port operates more as make was intended to operate and gives less headaches during execution. Based on this, the MinGW developers/maintainers/packagers decided it would be best to rename the native version so that both the "native" version and the MSYS version could be present at the same time without file name collision.
How can an MSVC program call a MinGW DLL, and vice versa?
Two methods exist, both described in MSVC-MinGW-DLL.
How can a JNI DLL be created?
A tutorial to create a Java Native Interface DLL can be found here: JNI-MinGW-DLL
My programs don't print output; how do I fix this?
This is a long standing issue. Page programs not print in MSYS holds information on bypassing this problem.
How do I pass switches with forward slashes to programs under MSYS?
Please view page switches with forward slashes
How do I enter the MSYS building environment?
Follow the instructions on MSYS Shell page
How do I build an MSYS binary?
You must be under a MSYS shell and tools environment to compile. Please refer to MSYS dependent for more information.
How do I compile MSYS?
Pages MSYS, Build MSYS and MSYS from scratch will get you started.
Why will the MSYS shell not open on Windows XP Professional x64?
Follow the instructions on MSYS Shell page
How do I execute configure scripts?
Applications using a UNIX-style build process will typically require a shell environment and set of POSIX tools, for executing configure scripts and building the application. The Cygwin environment was once the only choice available to fill this role, although now the MSYS environment offers MinGW developers a more lightweight alternative. The use of both these environments with MinGW is described in MSYS Shell and MinGWShell?. FIXME - This is confusing and doesn't describe the question. EarnieBoyd 2006-04-19