MinGW

Last updated
MinGW
Original author(s) Colin Peters
Developer(s) MinGW Project
Initial releaseJuly 1, 1998;26 years ago (1998-07-01)
Stable release
GNU BinUtils—2.32-1, Installation Manager—0.6.3, WSL—5.4.2 [1] / April 12, 2021;3 years ago (2021-04-12)
Repository osdn.net/projects/mingw/scm/
Written in C, C++
Operating system Microsoft Windows, Unix-like (as a cross compiler)
Type Compiler
License Public domain (headers), GNU General Public License (compiler and toolchain)
Website osdn.net/projects/mingw

MinGW ("Minimalist GNU for Windows"), formerly mingw32, is a free and open source software development environment to create Microsoft Windows applications.

Contents

MinGW includes a port of the GNU Compiler Collection (GCC), GNU Binutils for Windows (assembler, linker, archive manager), a set of freely distributable Windows specific header files and static import libraries which enable the use of the Windows API, a Windows native build of the GNU Project's GNU Debugger, and miscellaneous utilities.

MinGW does not rely on third-party C runtime dynamic-link library (DLL) files, and because the runtime libraries are not distributed using the GNU General Public License (GPL), it is not necessary to distribute the source code with the programs produced, unless a GPL library is used elsewhere in the program. [2]

MinGW can be run either on the native Microsoft Windows platform, cross-hosted on Linux (or other Unix), or "cross-native" on Cygwin. Although programs produced under MinGW are 32-bit executables, they can be used both in 32 and 64-bit versions of Windows.

The development of the MinGW project has been forked with the creation in 2005–2008 of an alternative project called Mingw-w64.

History

MinGW was originally called mingw32 ("Minimalist GNU for W32"), following the GNU convention whereby Windows is shortened as "W32". [3] [4] The numbers were dropped in order to avoid the implication that it would be limited to producing 32-bit binaries. Colin Peters authored the initial release in 1998, consisting only of a Cygwin port of GCC. [5] [6] Jan-Jaap van der Heijden created a Windows-native port of GCC and added binutils and make. [5] [6] Mumit Khan later took over development, adding more Windows-specific features to the package, including the Windows system headers by Anders Norlander. [5] [6] In 2000, the project was moved to SourceForge in order to solicit more assistance from the community and centralize its development. [5] [6]

MinGW was selected as Project of the Month at SourceForge for September 2005. [6]

MSYS (a contraction of "Minimal System") was introduced as a Bourne shell command line interpreter system [7] with the aim of better interoperability with native Windows software.

In 2018, following a disagreement with SourceForge about the administration of its mailing lists, MinGW migrated to OSDN. [8]

Fork

In 2007, a fork of the original MinGW called Mingw-w64 appeared in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution. MSYS2 ("minimal system 2") is a software distribution and a development platform for Microsoft Windows, based on Mingw-w64 and Cygwin, that helps to deploy code from the Unix world on Windows. [9]

Programming language support

Most languages supported by GCC are supported on the MinGW port as well. These include C, C++, Objective-C, Objective-C++, Fortran, and Ada. The GCC runtime libraries are used (libstdc++ for C++, libgfortran for Fortran, etc.).[ citation needed ]

MinGW links by default to the Windows OS component library MSVCRT, which is the C library that Visual C++ version 6.0 linked to (the initial target was CRTDLL), which was released in 1998 and therefore does not include support for C99 features, or even all of C89. While targeting MSVCRT yields programs that require no additional runtime redistributables to be installed, the lack of support for C99 has caused porting problems, particularly where printf-style conversion specifiers are concerned. These issues have been partially mitigated by the implementation of a C99 compatibility library, libmingwex, but the extensive work required is far from complete and may never be fully realized. [10] Mingw-w64 has resolved these issues, and provides fully POSIX compliant printf functionality.

Binaries (executables or DLLs) generated with different C++ compilers (like MinGW and Visual Studio) are in general not link compatible. However, compiled C code is link compatible. [11]

Components

The MinGW project maintains and distributes a number of different core components and supplementary packages, including various ports of the GNU toolchain, such as GCC and binutils, translated into equivalent packages. [12] [13] These utilities can be used from the Windows command line or integrated into an IDE. Packages may be installed using the command line via mingw-get. [14]

MinGW supports dynamic libraries named according to the <name>.lib and <name>.dll conventions, as well as static libraries following the lib<name>.a naming convention common on Unix and Unix-like systems.

In addition, a component of MinGW known as MSYS (minimal system) provides Windows ports of a lightweight Unix-like shell environment including rxvt and a selection of POSIX tools sufficient to enable autoconf scripts to run, [15] but it does not provide a C compiler or a case-sensitive file system. [16]

mingwPORTs are user contributed additions to the MinGW software collection. Rather than providing these "add-ons" as precompiled binary packages, they are supplied in the form of interactive Bourne shell scripts, which guide the end user through the process of automatically downloading and patching original source code, then building and installing it. Users who wish to build any application from a mingwPORT must first install both MinGW and MSYS. [17]

The implementation of Windows system headers and static import libraries are released under a permissive license, [18] while the GNU ports are provided under the GNU General Public License. Binary downloads of both the complete MSYS package and individual MinGW GNU utilities are available from the MinGW site.

Comparison with Cygwin

Although both Cygwin and MinGW can be used to port Unix software to Windows, they have different approaches: [19] Cygwin aims to provide a complete POSIX layer comprising a full implementation of all major Unix system calls and libraries. Compatibility is considered a higher priority than performance. On the other hand, MinGW's priorities are simplicity and performance. As such, it does not provide certain POSIX APIs which cannot easily be implemented using the Windows API, such as fork() , mmap() and ioctl() . [19] Applications written using a cross-platform library that has itself been ported to MinGW, such as SDL, wxWidgets, Qt, or GTK, will usually compile as easily in MinGW as they would in Cygwin.

Windows programs written with Cygwin run on top of a copylefted compatibility DLL that must be distributed with the program, unless statically linked. If dynamically linked, the program must also provide information on where to obtain Cygwin source. MinGW does not require a compatibility layer, since MinGW-based programs are compiled with direct calls to Windows APIs.

The combination of MinGW and MSYS provides a small, self-contained environment that can be loaded onto removable media without leaving entries in the registry or files on the computer.

It is also possible to cross-compile Windows applications with MinGW-GCC under POSIX systems. This means that developers do not need a Windows installation with MSYS to compile software that will run on Windows with or without Cygwin.

See also

Related Research Articles

<span class="mw-page-title-main">Cygwin</span> Unix-like environment for Windows

Cygwin is a free and open-source Unix-like environment and command-line interface (CLI) for Microsoft Windows. The project also provides a software repository containing many open-source packages. Cygwin allows source code for Unix-like operating systems to be compiled and run on Windows. Cygwin provides native integration of Windows-based applications.

The Portable Operating System Interface is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines system and user-level application programming interfaces (APIs), along with command line shells and utility interfaces, for software compatibility (portability) with variants of Unix and other operating systems. POSIX is also a trademark of the IEEE. POSIX is intended to be used by both application and system developers.

<span class="mw-page-title-main">GNU Autotools</span> GNU software packaging tools

The GNU Autotools, also known as the GNU Build System, is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems.

The C standard library, sometimes referred to as libc, is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it. Since ANSI C was adopted by the International Organization for Standardization, the C standard library is also called the ISO C library.

<span class="mw-page-title-main">DJGPP</span> Implementation of the GNU toolchain for DOS

DJ's GNU Programming Platform (DJGPP) is a software development suite for Intel 80386-level and above, IBM PC compatibles which supports DOS operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the GNU Compiler Collection (GCC), and mostly GNU utilities such as Bash, find, tar, ls, GAWK, sed, and ld to DOS Protected Mode Interface (DPMI). Supported languages include C, C++, Objective-C/C++, Ada, Fortran, and Pascal.

The GNU toolchain is a broad collection of programming tools produced by the GNU Project. These tools form a toolchain used for developing software applications and operating systems.

In computing, POSIX Threads, commonly known as pthreads, is an execution model that exists independently from a programming language, as well as a parallel execution model. It allows a program to control multiple different flows of work that overlap in time. Each flow of work is referred to as a thread, and creation and control over these flows is achieved by making calls to the POSIX Threads API. POSIX Threads is an API defined by the Institute of Electrical and Electronics Engineers (IEEE) standard POSIX.1c, Threads extensions .

<span class="mw-page-title-main">Dev-C++</span> Free C++ development environment

Dev-C++ is a free full-featured integrated development environment (IDE) distributed under the GNU General Public License for programming in C and C++. It was originally developed by Colin Laplace and was first released in 1998. It is written in Delphi.

GNU libiberty is a software library with a collection of subroutines used by various GNU programs. The library is now a decommissioned GNU package.

Interix was an optional, POSIX-conformant Unix subsystem for Windows NT operating systems. Interix was a component of Windows Services for UNIX, and a superset of the Microsoft POSIX subsystem. Like the POSIX subsystem, Interix was an environment subsystem for the NT kernel. It included numerous open source utility software programs and libraries. Interix was originally developed and sold as OpenNT until purchased by Microsoft in 1999.

The GnuWin32 project provides native ports in the form of executable computer programs, patches, and source code for various GNU and open source tools and software, much of it modified to run on the 32-bit Windows platform. The ports included in the GnuWin32 packages are:

MKS Toolkit is a software package produced and maintained by PTC that provides a Unix-like environment for scripting, connectivity and porting Unix and Linux software to Microsoft Windows. It was originally created for MS-DOS, and OS/2 versions were released up to version 4.4. Several editions of each version, such as MKS Toolkit for developers, power users, enterprise developers and interoperability are available, with the enterprise developer edition being the most complete.

UWIN is a computer software package created by David Korn which allows programs written for the operating system Unix to be built and run on Microsoft Windows with few, if any, changes. Some of the software development was subcontracted to Wipro, India. References, correct or not, to the software as U/Win and AT&T Unix for Windows can be found in some cases, especially from the early days of its existence.

Strawberry Perl is a distribution of the Perl programming language for the Microsoft Windows platform. Additionally, strawberry contains a fully featured Mingw-w64 C/C++ compiler with many libraries included. While most other distributions rely on the user having software development tools already set up to install certain Perl components, Strawberry Perl ships with the most commonly used tools preconfigured and packaged. It is a dramatic departure from other Perl distributions, and has influenced other distributions to provide such development tools in their own distribution.

mintty Open source terminal emulator

mintty is a free and open source terminal emulator for Cygwin, the Unix-like environment for Windows. It features a native Windows user interface and does not require a display server; its terminal emulation is aimed to be compatible with xterm.

In the C and C++ programming languages, unistd.h is the name of the header file that provides access to the POSIX operating system API. It is defined by the POSIX.1 standard, the base of the Single Unix Specification, and should therefore be available in any POSIX-compliant operating system and compiler. For instance, this includes Unix and Unix-like operating systems, such as GNU variants, distributions of Linux and BSD, and macOS, and compilers such as GCC and LLVM.

EMX is a programming environment for MS-DOS and OS/2. It allows creating and executing of 32-bit mode applications, presenting a POSIX API and, on OS/2, access to the OS/2 APIs.

DJGCC is a C development suite for x86 PCs that runs under DOS or compatibles. It is guided by DJ Delorie, who started the project in 1989. It is a port of the popular gcc compiler.

Mingw-w64 is a free and open-source suite of development tools that generate Portable Executable (PE) binaries for Microsoft Windows. It was forked in 2005–2010 from MinGW.

References

  1. "Download Package list". osdn.net. Retrieved 2023-02-04.
  2. "(MinGW on) MinGW". MinGW.org/wiki. 2008-07-07. Archived from the original on 2013-10-06. Retrieved 2013-10-16.
  3. "GNU Coding Standards". gnu.org. Free Software Foundation. April 27, 2013. 5.5 Portability between System Types. Retrieved July 1, 2013.
  4. Stallman, Richard (2000-09-18). "Libtool Re: Naming a project gnu-win32?". libtool (Mailing list). Retrieved 2013-05-21.
  5. 1 2 3 4 "History | MinGW". MinGW.org. Archived from the original on 2012-08-23. Retrieved 2012-07-09.
  6. 1 2 3 4 5 "(sourceforge's) Project of the Month". SourceForge.net. 2005-08-31. Retrieved 2012-07-09.
  7. "(wiki:) MSYS". MinGW.org. Archived from the original on 2006-08-28. Retrieved 2020-04-16. MSYS, a contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system.
  8. "Announcement of migration to OSDN.net". Mingw-users (Mailing list). January 21, 2018.
  9. MSYS2: official homepage, code repository
  10. "(MinGW And) C99". MinGW.org/wiki. 2010-06-21. Archived from the original on 2011-05-20. Retrieved 2011-03-29.
  11. "Interoperability of Libraries Created by Different Compiler Brands | MinGW". mingw.org. Archived from the original on 2010-06-12.
  12. "(MinGW) FAQ". MinGW.org. Archived from the original on 2008-11-21. Retrieved 2012-07-09.
  13. "MinGW - Minimalist GNU for Windows". Sourceforge.net. Retrieved 2012-07-09.
  14. "MinGW Command Line Interface Installer". Archived from the original on 15 June 2012. Retrieved 14 June 2012.
  15. "(wiki:) MSYS". MinGW.org. Archived from the original on 2016-02-18. Retrieved 2016-02-18.
  16. "(wiki:) MSYS". MinGW.org. Archived from the original on 2016-02-18. Retrieved 2016-02-18. A common misunderstanding is MSYS is "UNIX on Windows", MSYS by itself does not contain a compiler or a C library, [...] nor does it provide any UNIX specific functionality like case-sensitive filenames.
  17. "(wiki:) mingwPORT". MinGW.org. Archived from the original on 2012-07-23. Retrieved 2012-07-09.
  18. "(MinGW) Licensing Terms". MinGW.org. Archived from the original on 2009-08-04. Retrieved 2012-07-09.
  19. 1 2 "(MinGW:) About Cygwin". MinGW.org. Archived from the original on 2009-08-28. Retrieved 2012-07-09.