I just compiled a simple "Hello World!" program on Linux. For reference, here it is:
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
This program runs perfectly on Linux. The same code compiled on Windows can be run on Windows as well, but I can't seem to compile it on Linux with g++ myprog.cpp -o prog.exe
and then run it on Windows.
Shouldn't the machine code should be the same on Linux and Windows, because the program is the same?