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 ?
compile Windows exe...aren't they already executable?-coption to the compiler you are explicitly telling it to perform the compilation step only -- and to not produce an executable by linking.* .exefile should I just make sogcc -o main.exe main.c? The fact is that when I do it and try to ran this output filemain.exeI got this i.imgur.com/NUDCslM.jpg