MinGW和Cygwin都解决了C++跨平台交叉编译的问题,使Linux下的程序在Windows上编译运行成为可能。

  MinGW给习惯在Linux上开发的人员在windows上提供了一套类似的工具集;Cygwin主要是对于在Linux的程序,无需改动代码即可移植到windows上;gnuwin32主要是对习惯linux工具的人员,在windows上提供一套类似的命令

  Unix下编译通过的C代码,在win32下编译是不能通过的 ,当然Unix和win32的API都符合标准C,即大多数函数调用在unix和win32下是相同的.但unix有自己一些独特的API(如fork,spawn,signals,select,sockets等),如果代码中使用了这些API,在win32下当然找不到对应的库。但这些API的功能在win32中也能实现,下面提供两种让window编译Unix风格代码的方法:

  • 修改编译器,让window下的编译器把诸如fork的调用翻译成等价的形式,这就是MinGW的做法
  • 修改库,让window提供一个类似unix提供的库,它们对程序的接口如同unix一样,而这些库是由win32的API实现的,这就是Cygwin的做法

MinGW

  MinGW, a contraction of "Minimalist GNU for Windows", is a minimalist development environment for native Microsoft Windows applications.

  MinGW provides a complete Open Source programming tool set which is suitable for the development of native MS-Windows applications, and which do not depend on any 3rd-party C-Runtime DLLs.

  MinGW给在习惯在Linux开发的人员提供了一套在Windows上开发类似Linux的工具集,它包括一系列软件:编译工具、链接工具、转储工具、调试工具和其它开发工具等。MinGW还提供一些开源的基础支持库,像GNU的C/C++ RT库(libc、libstdc++),POSIX的基本调用界面(包括pthread),甚至还有OpenGL和Windows API的调用接口等。几乎所有MinGW中的软件都是从GNU项目或Linux下移植到Windows下的。

  与GNU不同的是,MinGW编译生成的是Windows下的可执行文件(.exe)或库文件(.dll,.lib),不过编译过程中的的中间文件仍然是.o文件,而不是.obj文件。

  MinGW的POSIX界面远没有Cygwin实现的那么全面(如:连BSD/Linux Socket都没有,只能用Winsock),所以MinGW只是用来开发Windows专属应用的工具集

  后来MinGW有了一个子项目叫:MSYS,其中包括了更多的Linux工具,其目标类似Cygwin:构建一套Windows下的Linux模拟环境。

  MSYS, a contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system. Offered as an alternative to Microsoft's cmd.exe, this provides a general purpose command line environment, which is particularly suited to use with MinGW, for porting of many Open Source applications to the MS-Windows platform; a light-weight fork of Cygwin-1.3, it includes a small selection of Unix tools, chosen to facilitate that objective.

  注:MinGW官网:http://www.mingw.org/

Cygwin

  Cygwin is:

  • a large collection of GNU and Open Source tools which provide functionality similar to a Linux distributionon Windows.
  • a DLL (cygwin1.dll) which provides substantial POSIX API functionality.

  Cygwin 名字来源于GNU、Cygnus、Windows三者的缩写。Cygwin的目标是:构建一套Windows下的Linux模拟环境。因此,Cygwin是一个庞大的项目,不只包括Linux下的开发环境,也包括工作环境和各种各样的Linux下的软件。

  在早期,Cygwin的核心是cygwin1.dll,可以认为它是一个POSIX界面的实现,依靠这个动态链接库,Unix/Linux下的软件可以很容易的移植到Windows下,并且风格保持原有的不变。不过,随着Cygwin的发展,越来越多的Unix/Linux程序的移植,建立基于Cygwin的复杂程序依赖的库也越来越多,现在装完默认配置的Cygwin后,就会发现有很多cyg打头的动态链接库。

注:

  Cygwin官网:http://www.cygwin.com/

  Cygwin中文网:http://www.cygwin.cn/

GnuWin32

  GnuWin32使windows用户可以在命令行窗口中使用各种各样的linux命令,就跟使用普通的windows命令一样简单。

  注:GnuWin32官网:http://gnuwin32.sourceforge.net/

CMake

  CMake is an open-source, cross-platform family of tools designed to build, test and package software.

  官网:https://cmake.org/

Cross-platform Tools的更多相关文章

  1. Android sdk platform,sdk tools,sdk Build tools,sdk platform tools 的关系

    1. sdk platform 简单理解为系统版本 最新级别: 28:Android 9 27:Android 8.1 26:Android 8.0 25:Android 7.1 24:Android ...

  2. “CMake”这个名字是“cross platform make”

    cmake_百度百科 https://baike.baidu.com/item/cmake/7138032?fr=aladdin CMake 可以编译源代码.制作程序库.产生适配器(wrapper). ...

  3. Comparing Xamarin and Delphi XE5 to Xcode for Cross Platform Mobile App Development

    Comparing Xamarin and Delphi XE5 to Xcode for Cross Platform Mobile App Development If you are consi ...

  4. V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245.1)

    V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245. ...

  5. Gtest:Using visual studio 2017 cross platform feature to compile code remotely

    参考:使用Visual Studio 2017作为Linux C++开发工具 前言 最近在学Gtest单元测试框架,由于平时都是使用Source Insight写代码,遇到问题自己还是要到Linux下 ...

  6. Cross Platform Note: STD C++ Preprocessor directives & pre-defined macros

    ref: http://www.cplusplus.com/doc/tutorial/preprocessor/ concolusion: directives: #define #undef #in ...

  7. Cross platform

    值得学习的C/C++语言开源项目 (1)ACE 庞大.复杂,适合大型项目.开源.免费,不依赖第三方库,支持跨平台. http://www.cs.wustl.edu/~schmidt/ACE.html ...

  8. Cross platform GUI for creating SSL certs with OpenSSL

    Someone said: from : https://micksmix.wordpress.com/2012/08/09/xca-cross-platform-gui-for-creating-s ...

  9. Deepin personalized transplantation of kali platform tools

    首先配置更新源: 把kali的源添加到 Deepin 自带的源后面: 简易换源方法: 1.打开文件管理 -> 地址栏输入路径:/etc/apt/ 然后回车->在目录中右键以管理员身份打开 ...

  10. .NET: 谈谈共享项目 (Shared Project) 的使用

    从 Visual Studio 2015 起,共享项目 (Shared Project) 作为新的一种项目类型被添加到项目模板列表中,它的主要目的是使多个不同类型的项目之间可以共享代码或资源.相比它的 ...

随机推荐

  1. Java的学习02

    今天依旧记录一下今天的学习的知识. /** * 测试StringBuilder StringBuffer,可变字符序列 * String对象称为“不可变对象"指的是对象内部成员变量的值无法再 ...

  2. Building and using plug-ins for Android

    [Building and using plug-ins for Android] 1.AAR plug-ins and Android Libraries Android Archive (AAR) ...

  3. destructuring assignment

    [destructuring assignment] The destructuring assignment syntax is a JavaScript expression that makes ...

  4. metasploit framework(四):生成payload

    RHOST是限制来源IP,这里不用修改 generate生成payload 假设'\x00'是坏字符,生成payload时就会对'\x00'进行编码,排除坏字符. -b 去掉坏字符 -t 指定生成的格 ...

  5. linux启动jmeter(二十三),执行./jmeter.sh报错解决方法(转载)

    转载自 http://www.cnblogs.com/yangxia-test 1.l-bash: ./jmeter.sh: Permission denied解决办法:jmeter.sh的执行权限改 ...

  6. http://ctf.bugku.com/challenges#Easy_Re

      今天做一道逆向题,开心,见证了自己汇编的用途.     首先看它是否加壳? 1.加壳检测   是vc编程的,没有加壳,可以愉快地分析了.   2.分析程序,找到flag.   首先运行一下子程序, ...

  7. 问题2:input、textarea、submit 宽度设置为100%,但显示宽度不一致

    <style type="text/css"> body{ padding: 10px; } input,textarea{ width: 100%; } </s ...

  8. elasticsearch的索引操作和文档操作总结

    参考文档:https://es.xiaoleilu.com/010_Intro/00_README.html 一.索引操作 1.查看当前节点的所有的index 查看当前节点的所有的index [roo ...

  9. django具体操作(七)

    新增组件 使用 python manage.py startapp新建一个app,并且在settings中注册,添加stark.apps.StarkConfig, 然后在stark的apps中添加re ...

  10. 自学之jQuery

    最近在公司做项目的过程中,涉及到写前端部分,因为之前一直很少写前端,所以不是很熟悉,所以,在此写一下自学jQuery的过程,以及中途遇到的坑. 首先,要想使用jQuery必须先引入jQuery < ...