Wonfee / msys-cn

Automatically exported from code.google.com/p/msys-cn
0 stars 0 forks source link

能编译基于Linux的c语言程序吗? #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
有现成的程序,.c,.h,和makefile

可是当我输入 
make之后,出现了一堆错误,最开头是系统不知道。

我就是想在windows下运行linux的c程序才装你这个系统的啊,能�
��能用啊?

Original issue reported on code.google.com by amazingj...@gmail.com on 20 Jun 2010 at 4:42

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by dynasp...@gmail.com on 23 Jul 2010 at 4:10

GoogleCodeExporter commented 8 years ago
首先明确以下概念:
Msys是一个类似Unix的环境,提供与GNU/Linux的CLI类似的用户体验
,一堆GNU的工具搭配起来以方便工作;
MinGW是一个跨平台的编译环境,它仅用于使用类似GNU/Linux下进
行程序开发的方法来生成原生Windows应用程序(一般要依赖于M
SVCRT.dll,但大部分仅依赖于它),其作用与Microsoft的VC等类似
,用于进行Windows本土程序开发。
MinGW提供大部分与VC功能相同的头文件和库,可以进行Win32API��
�序开发、OpenGL程序开发(Msys-cn中好像不是OpenGL而是DirectX)��
�等。经过特定配置之后可以编译大部分Windows程序,其产生的
目的之一是取代VC等商业编译环境,而不是将Linux应用程序源�
��移植到Windows下,——要做到这个,您可以考虑选择Cygwin。
MinGW ("Minimalistic GNU for Windows") is a collection of freely available and 
freely distributable Windows specific header files and import libraries 
combined with GNU toolsets that allow one to produce native Windows programs 
that do not rely on any 3rd-party C runtime 
DLLs(来自:http://mingw.org/wiki/MinGW)

当然,Cygwin能做到的也仅仅是源码编译到Cygwin环境下,生成��
�要Cygwin1.dll等模拟层支持的Windows应用程序。
# Cygwin is not a way to run native linux apps on Windows. You have to rebuild 
your application from source if you want it to run on Windows.
# Cygwin is not a way to magically make native Windows apps aware of UNIX ® 
functionality, like signals, ptys, etc. Again, you need to build your apps from 
source if you want to take advantage of Cygwin functionality. 
(来自:http://cygwin.com/)
由于GNU/Linux下的好多功能在Windows下无法实现,即使Cygwin也不�
��保证所有GNU/Linux的程序能源码移植。

Original comment by suxp...@gmail.com on 22 Aug 2010 at 7:58