Windows 10 Anniversary Update includes the Linux Subsystem for Ubuntu. I installed gcc with sudo apt-get install gcc
.
I wrote some simple C code for testing purposes:
#include <stdio.h>
int main(void){
printf("Hello\n");
return 0;
}
And compiled it with gcc -c main.c
but the execute (Linux only) main.o
is generated. If I run it ./main.o
, it displays Hello
.
My question is, how can I compile main.c
so that Windows can run it? Basically, how do you generate a *.exe
file with GCC in Linux Subsystem ?