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

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

问题描述

好吧,伙计们,希望这是一个相当简单的问题:
有没有什么办法来运行Windows操作系统linux下用gcc编译C程序?
请不要告诉我重新编译windows下的,因为我已经试过,但貌似没有C编译器的窗口有128个位本机类型,并使用BIGNUM库,使我的程序像10到100倍速度较慢。
有什么办法来实际运行Windows下的Linux二进制?
有人告诉我一些关于Cygwin的,但我不知道从哪里开始使用它。 (我的程序应该是可移植一样,所以我souldn't需要我的机器上安装的程序和东西)。

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).

非常感谢你!
利玛窦

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中安装Linux。运行程序存在。

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

http://www.andlinux.org 有这样一个框架。我从来没有尝试过,但有一个视频教程<一个href=\"http://www.youtube.com/watch?v=nULDHPCm9p4\">http://www.youtube.com/watch?v=nULDHPCm9p4.

http://www.andlinux.org has a framework for doing this. I've never tried it, but there is a video tutorial http://www.youtube.com/watch?v=nULDHPCm9p4.

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

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