Cygwin:如何实际使用gcc-mingw [英] Cygwin: How to actually use gcc-mingw

查看:509
本文介绍了Cygwin:如何实际使用gcc-mingw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于gcc -mno-cygwin不再工作,我正在寻找一种方法来获取一个MinGW目标GCC在我的Cygwin环境中运行。 (此时运行MSYS环境不是一个选项。)

Since "gcc -mno-cygwin" does not work anymore, I was looking for a way to get a MinGW-targeted GCC running within my Cygwin environment. (Running a MSYS environment is not an option at this point.)

Cygwin安装程序提供了一个包gcc-mingw,其中安装了:

The Cygwin installer offers a package "gcc-mingw", which installs, among others:

lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe
lib/gcc/i686-pc-mingw32/3.4.4/collect2.exe
lib/gcc/i686-pc-mingw32/3.4.4/crtbegin.o
lib/gcc/i686-pc-mingw32/3.4.4/crtend.o

缺少的是gcc前端。那么,我怎么实际调用这个编译器呢?我希望不需要手动通过cc1,有我吗?

What is absent is the "gcc" frontend. So, how do I actually invoke this compiler? I hopefully don't have to go through "cc1" manually, have I?

我googled,但找不到任何相关的主题...


I googled, but couldn't find anything relevant on the subject...

推荐答案

正如你已经发现的,你可以使用gcc-3和 -mno-cygwin 。另一种可能性是安装来自MinGW-w64项目的32位和/或64位工具链,这些工具链最近已经为Cygwin打包,因此现在可以通过setup.exe获得。不要被相当混乱的可执行文件推迟: i686-w64-mingw32-gcc 是32位编译器, x86_64-w64- mingw32-gcc 是64位的。

As you already found, you can use gcc-3 with -mno-cygwin. The other possibility is to install the 32-bit and/or 64-bit toolchains from the MinGW-w64 project, which have been packaged for Cygwin very recently and hence are available through setup.exe now. Don't be put off by the rather confusing executable names: i686-w64-mingw32-gcc is the 32-bit compiler and x86_64-w64-mingw32-gcc is the 64-bit one.

这篇关于Cygwin:如何实际使用gcc-mingw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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