mingw-minimalist GNU for Windows
Mingw32 is a collection of GNU project tools that contains a large number of header files, libraries, and instructions. The purpose is to provide a free tool for the production of a native program (Native Windows programs) that can be directly executed on WINODWS without a dependent helper library.
In the Debian system, you can install the DEBIANPACKAGES:MINGW32, Debianpackages:mingw32-binutils, and debianpackages:mingw32-runtime three package software.
- Debianpackages:mingw32-minimalist GNU Win32 (Cross) compiler contains Win32 Trans-platform translator
- Debianpackages:mingw32-binutils-minimalist GNU Win32 (Cross) binutils contains Win32 platform instruction set
- Debianpackages:mingw32-runtime-minimalist GNU Win32 (Cross) runtime function library and target files
Debianpackages:mingw32 includes g++ (c++,cpp), GCC (cc), Gcov, Gccbug, and other required Win32 cross-platform translators, which you need to produce EXE that can be used on Microsoft Windows , DLL files, and so on. Debianpackages:mingw32-binutils are nm, strip, AR, Ranlib, Dlltool, as, LD, Windres, addr2line, size, objdump, readelf, etc. The necessary tools for producing native programs. These instructions are different from native translators, and the records are very different from other software, and are in/usr/i586-mingw32msvc/. The directive naming principle also starts with i586-mingw32msvc.
For example, a console executable is generated.
[Email protected]:~$ cat Hello.cpp
#include <iostream>
int main (int argc, char* argv[])
{
Std::cout << "Hello world\n";
return 0;
}
[Email protected]:~$ i586-mingw32msvc-g++-o hello.exe hello.cpp
[Email protected]:~$ file Hello.exe
Hello.exe:MS Windows PE 32-bit Intel 80386 console executable not relocatable
If you install wine, you can even perform it directly. Because wine is used in conjunction with Binfmt-support, your system should be aware of the. exe file and execute it in wine.
[Email protected]:~$./hello.exe
Hello World
Wine exited with a successful status
or edit a graphical user interface program that shows a message window
[email protected]:~$ cat > Hello.cpp
#include <windows.h>
{
MessageBox ( NULL, "Hello, world!", "", MB_OK);
return (0);
}
[email protected]:~$ i586-mingw32msvc-g++-o hello.exe hello.cpp-mwindows
[email protected]:~$ file hello.exe
hello.exe:ms Windows PE 32-bit Intel 80386 GUI Executable not relocatable
You probably notice that the "-mwindows" parameters are added to the directive, which is used to build "Windows application" rather than "Console application" and ensure that the Windows Library is used during the connection (linking) process. In the example above we only show the "Hello World" string, which is called "Console Application", which will activate a console window. You can add "-mconsole" to edit "Console application".
Through Mingw32 's help, you can design a C + + program for "Write Once, Run Everywhere" on the Linux system, such as putty for Unix, Mac, and Windows on Linux platforms.
Taken from "Http://wiki.debian.org.tw/index.php/Mingw32"
This page has been browse 2,126 times. Last change 10:02 July 14, 2005. All Jong Yun of this site are used in the following ways: GNU Free Documentation License 1.2