Home >Backend Development >C++ >How Can I Cross-Compile Windows Executables Using MinGW on Linux?
Cross-Platform Compilation with MinGW for Windows Executables
Cross-compiling Windows executables on a Linux system can be achieved using MinGW (Minimalist GNU for Windows). MinGW is a development environment that provides a GCC (GNU Compiler Collection) compiler for Windows.
To compile for Windows on Linux using GCC/G , proceed as follows:
Install MinGW:
Install the appropriate MinGW package for your Linux distribution, e.g., on Ubuntu:
$ apt-cache install mingw-w64
Cross-Compile:
Modify your GCC command to use the MinGW compiler, e.g.:
x86_64-w64-mingw32-gcc-win32 -Wall -lglut part8.cpp -o part8.exe
Link Required Libraries:
Additional Tips:
The above is the detailed content of How Can I Cross-Compile Windows Executables Using MinGW on Linux?. For more information, please follow other related articles on the PHP Chinese website!