How to convert a linux executable file (binary) to windows exe file?

前端 未结 4 1087
不思量自难忘°
不思量自难忘° 2021-01-05 09:20

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;         


        
相关标签:
4条回答
  • 2021-01-05 10:07

    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
    
    0 讨论(0)
  • 2021-01-05 10:11

    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

    0 讨论(0)
  • 2021-01-05 10:15

    If you have the lastest windows 10. Just install linux subsystem in the appstore. you can run whatever linux binary in windows you want

    0 讨论(0)
  • 2021-01-05 10:19

    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)

    0 讨论(0)
提交回复
热议问题