Cygwin上的C编译器生成什么? [英] What do the C compilers on Cygwin generate?

查看:281
本文介绍了Cygwin上的C编译器生成什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据下面的identify-compilers.sh脚本的输出,看起来Cygwin上提供了以下C编译器。

Based on the output of the identify-compilers.sh script below, it appears that the following C compilers are available on Cygwin. Those labeled "Cygwin" require the cygwin1.dll file to be available.

pc和w64编译器有什么区别?

What is the difference between the "pc" and "w64" compilers?

为什么没有x86_64-pc-mingw-gcc.exe可执行文件?

Why is there no x86_64-pc-mingw-gcc.exe executabe?

有没有其他C编译器可用? p>

Are there any other C compilers available?

/usr/bin/gcc.exe                        64-bit  Cygwin
/usr/bin/i686-pc-cygwin-gcc.exe         32-bit  Cygwin
/usr/bin/i686-pc-mingw32-gcc.exe        32-bit
/usr/bin/i686-w64-mingw32-gcc.exe       32-bit
/usr/bin/x86_64-pc-cygwin-gcc.exe       64-bit  Cygwin
/usr/bin/x86_64-w64-mingw32-gcc.exe     64-bit

$ cat identify-compilers.sh
#!/bin/bash
for c in $(ls -1 /usr/bin/*gcc.exe); do
    echo === compiler: $c
    $c -o hello.exe hello.c
    objdump -p hello.exe | grep -i "cygwin"
    objdump -p hello.exe | grep -i "64$"
    rm hello.exe
done


推荐答案


  1. gcc 只是一个硬链接到 x86_64-pc-cygwin -gcc

x86_64-pc-cygwin-gcc c $ c> i686-pc-cygwin-gcc 就像你说的
Cygwin编译器,也就是说编译器创建的程序依赖
cygwin1.dll

x86_64-pc-cygwin-gcc and i686-pc-cygwin-gcc are as you have said the Cygwin compilers, that is to say the compilers that create programs that rely on cygwin1.dll

x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc 是编译器提供
Mingw-w64项目

i686-pc-mingw32-gcc MinGW项目提供的编译器

你可能会想,为什么两个Mingw项目?那么Mingw-w64项目是
,因为MinGW 拒绝采用 64位编译器。在此
MSYS2项目的开始之前,我认为MinGW项目
已过时。

You may be wondering, why the two Mingw projects? Well the Mingw-w64 project was started because MinGW refused to adopt the 64-bit compiler. Between this and the starting of the MSYS2 project, I consider the MinGW project obsolete.

这篇关于Cygwin上的C编译器生成什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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