我必须开发一个可以在Linux + Windows上运行的exe文件 [英] I have to develop an exe file that runs on Linux + Windows

查看:533
本文介绍了我必须开发一个可以在Linux + Windows上运行的exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须开发一个小的.exe文件,下载后无需在Windows和Linux上进行任何安装即可直接运行.和exe的大小应小于1mb.哪个是最好的开发者.

I have to develop a small .exe file that will run directly after download without any installation on windows and linux. and size of the exe should be less than 1mb. Which is the best dev. tool/language to use.

推荐答案

如果您同意使用.NET和C ++/CLI而不是纯C ++,则可以创建将在其他OS上运行的.NET软件. (当然,在Linux上也是如此),而无需重新编译.

参见:
http://en.wikipedia.org/wiki/Mono_(软件) [ http://www.mono-project.com/ [
If you agree to use .NET and C++/CLI instead of plain C++ you can create .NET software which will run on another OS (and of course on Linux) under Mono without re-compilation.

See:
http://en.wikipedia.org/wiki/Mono_(software)[^],
http://www.mono-project.com/[^].

You will need to use the standard subset of .NET library plus number of non-standard assemblies like System.Windows.Forms to be compatible with Mono. You can also install Mono on Windows and run it under Mono on Windows or use it for development. I develop my windowed UI with Forms and run it on Linix without re-compilation. This is the only opportunity supported by C++ I know. (Another popular way is Java, but you''re asking only about C++, right?)

There is a number of other platforms to write UI using C++ which can be run on Windows and Linux, but they all will need separate build for each system. It includes GTK++, Qt and more.

Good luck,
—SA


如果您说要使用本机C ++,则不可能.
您必须使用适当的编译器和链接器分别为Windows和Linux构建它.
即使是在Windows上,当您需要提供32位和64位可执行文件时,也需要为它们提供两个单独的版本.
If you say, you want to use native C++, then it''s not possible.
You must build it separately for Windows and Linux, using appropriate compiler, and linker.
Even on Windows when you need to give both 32-bit and 64-bit executables, you need to have two separate builds for them.


我是这里唯一注意到这一点的人遗漏葡萄酒禁令吗?
人们一直在这样做,您无需诉诸.NET或重新编译.

我得到的所有Linux发行版都随附了gcc和wine.可以向您保证,与(linux)gcc在这些部分上所做的功夫相比,酒得到的锻炼要多得多.

当然,葡萄酒不是不能防弹的,也不是每个发行版的一部分-尽管都没有提到这两个限制.

给出问题的语气给我建议了功课,而且没有提及限制/要求以防止使用葡萄酒的限制-我只是将其编译在软木包装盒上,然后在任何一个上运行.

如果足以使MS Office在wine下无需安装即可在linux上运行(必须先使程序的thinstall版本-自包含的usb便携式版本)运行,那么methink对您的项目已经足够了.
Am I the only person here that has noticed the glaring ommission of a wine prohibition?
People do it all the time, you don''t need to resort to .NET or to recompilation.

All of the linux distros I get come with both gcc and wine. A can assure you that wine gets far more of a workout than (linux''s)gcc does around these parts.

Sure wine isn''t bomb-proof, nor is it a part of every distro - though neither of these were mentioned as being restrictions.

Given the tone of the question suggests homework to me, and that there is no mention of restrictions/requirements that prevent the use of wine - I''d just compile it on a windoze box and run it on either.

If it''s good enough for MS Office to run in linux without installation (must make thinstall version of program first - self-contained usb-portable version) under wine, then it''s plenty good enough for your project, methinks.


这篇关于我必须开发一个可以在Linux + Windows上运行的exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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