I am almost sure my problem is due to the fact that the compiled program is compiled as a linux executable, but I just want to double check this.
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return EXIT_SUCCESS;
}
The above "program" should compile on Windows and Linux just fine, since it is source code compatible, as there are no operating system specific libraries or anything like that.
Yet, when I type in "c99 hello.c -o hello.exe" on my Linux box, and then transfer that "executable" to a windows machine, it refuses to run. From what I understand, Linux generates an executable file that only runs on linux, so adding ".exe" has no effect. To build that program on Linux for Windows, I would need to recompile that program on a Windows machine? Or is there another simpler method that will work?