windows exe 到 linux exe

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1619094/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:20:01  来源:igfitidea点击:

windows exe to linux exe

windowslinux

提问by suresh

Is there a software that will convert a windows executable to linux executable rather than emulating windows api in linux(wine)?

是否有软件可以将 windows 可执行文件转换为 linux 可执行文件,而不是在 linux(wine) 中模拟 windows api?

回答by Michael Todd

If you have the source code, you can recompile it to use a different platform. However, that's not always as simple as merely compiling it. If there are any platform-dependent calls (Windows API, for example), they're going to have to be completely re-written to accomodate the new platform.

如果您有源代码,您可以重新编译它以使用不同的平台。然而,这并不总是像仅仅编译它那么简单。如果有任何依赖于平台的调用(例如 Windows API),则必须完全重新编写它们以适应新平台。

In the short term, an emulator is your best bet. If you don't have access to the source code, there's no way that I'm aware of to do it.

在短期内,模拟器是您最好的选择。如果您无权访问源代码,则我不知道这样做的方法。

回答by Chris Huang-Leaver

If the Windows exe is actually C# (or other .net) bytecode, you might be able to run it using mono. You can check with the 'file' command

如果 Windows exe 实际上是 C#(或其他 .net)字节码,您也许可以使用单声道运行它。您可以使用“文件”命令进行检查

 $ file hello.exe
hello.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit Mono/.Net assembly

Other than that, it's either Wine or rewrite the app, like others' here have suggested.

除此之外,它要么是 Wine 要么重写应用程序,就像其他人在这里建议的那样。

回答by Rodney S. Foley

It is not possible to "convert" an executable compiled for one platform/architecture to another. (ie Windows to Linux, Windows to Mac OS X, Mac OS X to Linux, etc)

不可能将为一个平台/架构编译的可执行文件“转换”到另一个平台/架构。(即 Windows 到 Linux、Windows 到 Mac OS X、Mac OS X 到 Linux 等)

You choices to use WINE or a Virtual Machine environment. WINE is great if you have an simple older Windows program Windows 2000 and some XP stuff works well enough, but if its complex or uses some 3rd party librarys or Microsoft ones that haven't been ported it will not work or not work right.

您可以选择使用 WINE 或虚拟机环境。如果你有一个简单的旧 Windows 程序 Windows 2000 和一些 XP 的东西足够好,WINE 很棒,但是如果它很复杂或使用一些 3rd 方库或尚未移植的 Microsoft 库,它将无法工作或无法正常工作。

I find that VM environments work best. I would recommend using VirtualBoxthis is a very good, free, cross platform visualization software for x86 architectures.

我发现 VM 环境效果最好。我建议使用VirtualBox,这是一个非常好的、免费的、跨平台的 x86 架构可视化软件。

回答by dicroce

No there is not.

不,那里没有。

回答by Vereb

No, there is not. Just one reason of many: the libraries and the kernel calls that they use are different.

不,那里没有。这只是众多原因之一:它们使用的库和内核调用不同。