Is there any way to convert a Linux binary file to windows exe file? For example if in Linux create a very simple binary file like this:
echo \"main(){int i;
You can not convert a linux executeable into a windows executeable. But you can compile the source with cross-compiler.
E.g: MinGw32
if you are in ubuntu:
sudo apt-get install mingw32
i586-mingw32msvc-cc main.c -o main.exe
If you need to run your code/app/program in linux/mac/windows under another OS (linux to win or reverse exc..) but you don't want to use virtual machines or wsl systems you can use docker. Here is link: https://www.docker.com But you will need to learn first. What Is Docker? Docker is similar in concept to Virtual Machines, except it’s much more lightweight. Instead of running an entire separate operating system (which is a massive overhead), Docker runs containers, which use the same host operating system, and only virtualize at a software level
If you have the lastest windows 10. Just install linux subsystem in the appstore. you can run whatever linux binary in windows you want
There are no means to convert the binary.
Regular ways to go are:
Recompile for other platform, but this requires the source (and cross-platform support in the source or the used libraries must be available on the other platform as well). cygwin
/mingw
, for example, can help providing the required support/libraries.
wine
could be used to run Windows binaries on Linux (but not the other way around)