Hi xor
... I asked artificial intelligence this as a fantasy
Can you create a compiled and executable binary exec that can run on both Linux and Windows?
the answer is positive ...
Linux and Windows use different file formats for their binaries.
I'm going to suggest the answer is probably negative.
... At first I thought it was a hallucinogenic answer,
But when I research the subject,
I learned that there is cross compilation that can work on both Linux and Windows.
And the hallucinations continue. You are talking about two completely
different things.
Cross compilation means compiling for a different architecture and/or
operating system than you are currently running on.
You can compile a Windows binary on a Linux system, but you
won't be able to run it on Linux.