在Linux上为COFF或在Windows上为ELF [英] COFF on Linux or ELF on Windows

查看:148
本文介绍了在Linux上为COFF或在Windows上为ELF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在UNIX上运行COFF可执行文件或在Windows上运行ELF可执行文件?能够在Windows和UNIX上运行这两种文件类型的步骤是什么.我只是好奇.

Is it possible to run the COFF executable files on UNIX or the ELF executable files on Windows? And what would be the steps to be able to run either file type on Windows and UNIX. I'm just curious.

推荐答案

要真正运行可执行文件并使它们执行有用的工作,您需要担心的是API,而不仅是可​​执行文件的格式.在安装了WINE的Linux计算机上,您可以从命令行运行Windows .EXE文件,它们的作用与在Windows上的作用相同.

To actually run executables and have them do useful stuff, you need to worry about the API, not just the executable file format. On a Linux machine with WINE installed, you can run Windows .EXE files from the command line and they do the same thing that they do on Windows.

实际上不可能采取另一种方法,但是,如果在Windows计算机上安装CYGWIN,然后使用CYGWIN编译器从源代码重建应用程序,则将获得在Windows上运行并与Linux相同的可执行文件.可执行文件在Linux上执行.许多标准的Linux工具已经被移植到CYGWIN库中,其中包括X-Windows和GIMP之类的东西.

The other way around is not really possible, however if you install CYGWIN on a Windows machine, and then rebuild the application from source with CYGWIN compilers, you will get an executable that runs on Windows and does the same thing that the Linux executable does on Linux. Lots of standard Linux tools are already ported and in the CYGWIN repository including stuff like X-Windows and GIMP.

这篇关于在Linux上为COFF或在Windows上为ELF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆