To make windows executable file(.exe) from GNU/Linux you need a Cross-Compiler named ” mingw32
”
-
Installation
If you using Ubuntu then install “mingw32
".You can install it many ways but if you are lazy as like me then you can use terminal.Give this command on terminal.
sudo apt-get install mingw32
Replace “apt-get” with “yum” or whatever your linux distro uses.
To compile C source code give below command on terminal
i586-mingw32msvc-cc main.c -o main.exe
here main.c is your c source file and main.exe is you desire .exe file name.
To compile C ++ source code give below command on terminal
i586-mingw32msvc-c++ clock.cpp -o clock.exe
here clock.cpp is your c++ source file and clock.exe is you desire .exe file name.
Now you can run those main.exe and clock.exe on Windows OS. if you want to run those .exe file on linux you need wine or other software that can run windows executable file. I prefer to use wine its free.
to install wine on Ubuntu give this command on terminal
sudo apt-get install wine
Replace “apt-get” with “yum” or whatever your linux distro uses.
now type on terminal
wine main.exe