14
3
For some odd reason, make
kept giving me tabulation errors when compiling on Windows, so I tried it on Ubuntu and it worked just fine.
Now I would like to use the executable I got from compiling on Ubuntu and use it on Windows. However, the file type I am getting is different when I download it on Windows, as it is just type file
. Is it possible to run it on Windows given that it was compiled on Ubuntu?
8You cannot run Linux executables on Windows unless you are using a Windows Subsystem for Linux instance to run them. If you want an executable that can run within Windows you must compile it on Windows. – Ramhound – 2019-06-03T15:07:45.900
14
make
gave you errors on Windows possibly because it wasn't GNUmake
, or possibly it was confused by line endings. Of course, even if you could getmake
to work doesn't mean that the code will compile on Windows. – jamesdlin – 2019-06-04T03:23:09.9073
An alternative (thus not an answer) might be to compile and run it in the Linux subsystem on Windows https://docs.microsoft.com/en-us/windows/wsl/install-win10.
– None – 2019-06-04T08:11:13.133@Leonhard - correct! I don't have enough experience with it to write an answer but the WSL specifically allows Ubuntu Linux binaries to run on Windows 10 (subject to some restrictions, mainly: no GUI). It's intended to facilitate running a Ubuntu toolchain to build Ubuntu binaries on Windows (for deployment elsewhere, e.g., the cloud, or a VM, or a container). Depending on the OP's use case this may be the easiest approach of all. – davidbak – 2019-06-04T18:32:20.007