在windows下运行linux gcc编译的程序 [英] Running linux gcc-compiled program under windows

查看:730
本文介绍了在windows下运行linux gcc编译的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,伙计们,希望这是一个很简单的问题:
有没有办法运行一个C程序编译下linux与GCC在Windows操作系统上?
请不要告诉我重新编译它在windows下,因为我已经尝试,但看起来像没有c windows编译器有128位本机类型,使用bignum库使我的程序比10到100倍慢。
有什么办法在Windows下实际运行linux二进制文件?
有人告诉我关于cygwin的一些事情,但我不知道在哪里开始使用它。 (我的程序也应该是可移植的,所以我不需要在我的机器上安装程序和东西)。

Ok, guys, hope this is quite a simple question: is there any way to run a C program compiled under linux with gcc on a windows operating system? Please don't tell me to recompile it under windows, since I already tried but looks like no c windows compiler has 128 bit native type, and using bignum libraries makes my program like 10 to 100 times slower. Is there any way to actually RUN the linux binary under windows? Someone told me something about cygwin, but I don't know where to get started with it. (My program should be portable as well, so I souldn't need to install programs and stuff on my machine).

非常感谢!
Matteo

Thank you very much!! Matteo

推荐答案

没有直接的方法。 Linux可执行文件的格式与Windows完全不同。还有其他几个选项。

No direct way. A Linux executable has a radically different format than Windows. There are several other options.


  • cygwin。在cygwin下用GCC编译程序。我相信会构建一个使用cygwin兼容层的windows exe。

  • cygwin. Compile the program with GCC under cygwin. I believe that will build a windows exe that uses the cygwin compatibility layer.

安装一个类似VBox的虚拟机。在VBox中安装Linux。运行程序。

install a VM like VBox. Install a Linux in the VBox. Run the program there.

http://www.andlinux.org < a>有一个框架。我从未尝试过,但有一个视频教程 http://www.youtube.com/ watch?v = nULDHPCm9p4

这篇关于在windows下运行linux gcc编译的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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