-
Compiling Issues
Hi,
When compiling in emacs in linux i can not run the .exe in windows, though i can in Linux.
How do i compile a .c program to run in Windows?
And likewise when compiling in Dev-C and trying to run the .exe in Linux it doesn't work.
Any help would be grateful
Jon
-
Ehm, because "everything" is different, except perhaps the processor.
Windows uses PE/COFF formated executable files, and Linux uses ELF or a.out format executables. On top of that, Windows and Linux have different API's (that is, the functions to read & write files, ask the OS what time it is, or ask for more memory, just to give a few examples) is different. Even the ABI (application binary interface) is different. The ABI is a sort of agreement between the compiler and the OS about "how you transfer information, and what registers to use for what".
It's like saying "why can't I just take my Ford engine and bolt it straight into my Nissan" - they weren't built to "plug'n'play" together!
--
Mats
-
More cross-border posting.
-
I like your answer, Salem.
--
Mats