cygwin编译的win32程序不需要cygwin1.dll库的方法(2)

文章讨论了GCC更新后不再支持-mno-cygwin选项的情况,并介绍了如何通过安装MinGW来解决相关编译问题,提供了一个简单易用的安装指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

新版本的gcc已经不支持 -mno-cygwin了。在cygwin中编译(1)中的代码,会出现如下的信息:

gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

提示说要可以用MinGW来代替,gcc好人性化,赞!


google了下,国内的大部分都是说加上-mno-cygwin就可以不依赖cygwin1.dll库了,但是并没有说新版本的gcc不支持-mno-cygwin编译选项了。


去MinGW网站http://www.mingw.org/,下载在线安装包mingw-get-inst-20110530.exe,这样安装的好处是不需要自己去设置环境变量,直接下一步下一步,选择安装gcc,g++,msys base system等包,安装完成就可以在windows下使用gcc和g++编译器了。


转载自mingw官网

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. (Itdoes depend on a number of DLLs provided by Microsoft themselves, as components of the operating system; most notable among these is MSVCRT.DLL, the Microsoft C runtime library. Additionally, threaded applicationsmust ship with a freely distributable thread support DLL, provided as part of MinGW itself).

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值