Windows EXE Using Windows 10 Linux Subsystem

You are here:
< All Topics

I mean, I did it, ’cause, but Visual Studio is free, so ….. *shrug*

In the Control Panel, find and enable the Windows Linux Subsystem Windows 10 Feature. You will have to Restart.

Visit the Microsoft App Store and search for Debian (or other Linux that is there, but I wanted Debian). Install it. Launch it. You will have to create a Linux user/password. This can be whatever you want. It will have sudo capability. Pretend your Windows 10 username (not your Linux one) is “Haath” for the example below.

Be a good kid and run your updates:

sudo apt-get update && sudo apt-get upgrade

as usual! Install the MinGW cross-compiler-linker tool chain:

sudo apt-get install mingw-w64

vi up a helloworld.cpp. Then build it:

i686-w64-mingw32-g++ -static-libstdc++ -static-libgcc helloworld.cpp -o helloworld.exe

cp helloworld.exe /mnt/c/Users/Haath/Desktop/

In a Windows 10 command prompt (run cmd.exe):

Desktop\helloworld

Your anti-virus software is more likely than not to complain about it. Ironic, eh? If so, you’ll have to whitelist it with your AV software.

Table of Contents