TDM-GCC是从mingw-w64项目patch而来,全部使用静态链接,对线程不需要额外的DLL,默认使用SJLJ异常(真是好东西)

Windows版GCC之TDM-GCC 4.5.2

平时写 C/C++ 小程序的时候,不喜欢开VS,太庞大了,还要建项目。对于小程序,一个可以进行单文件编译的 IDE 是我的首选,我用的是 C-Free 5.0,内置编译器 MinGW,Windows 版 GCC。

前几在 C-Free 5.0 上写排序程序,想看一下大概的执行时间,于是用 C 标准库函数 clock() ,结果包含的 time.h 头文件一直不能通过编译。把源代码复制到 VS 2008 里居然顺利编译通过,猜想这应该是编译器 MinGW 的问题,忍忍吧。

前天把系统搞得一踏糟,无奈之下还原,今天找了个最新版的 MinGW 编译器,没想到 time.h 头文件的问题没了,爽。

其实我用的不是 MinGW 官方版,而是另一个发行版本 TDM-GCC,目前最新版 4.5.2,一下翻译一段介绍:

TDM-GCC是一个 Windows 版的编译器套件。
它结合了 GCC 工具集中最新的稳定发行版本,包括了自由并开源的 MinGW 或 MinGW-w64 的运行时 APIs,以此创建一个 LIBRE 来替代微软的编译器及其平台 SDK。
它可以创建自 Windows 95 以来任何 Windows 操作系统版本之上的 32 位或 64 位的二进制文件。

提供一个下载地址:http://tdm-gcc.tdragon.net/

另外在某博客上有下面一段话:

TDM (Twilight Dragon Media) 和 MinGW官方没有任何瓜葛。TDM中包的版本一般比MinGW官方版新,似乎有MinGW的成员也在用TDM版。力挺这个的人似乎也挺多。

TDM GCC 分两个版本(异常处理方式不同)

SJLJ (setjmp/longjmp) 
DW2 (Dwarf-2) 
MinGW 中采用的是后者,TDM GCC 建议首选前者。

http://www.cnblogs.com/wxxweb/archive/2011/05/30/2063434.html

-----------------------------------------------------------------------------------------------------------------

自我说明:

TDM-GCC is pleased to present new toolchains based on GCC 5.1.0, as well as updated GDB packages for 32-bit and 64-bit native Windows.

This TDM-GCC release incorporates a few more local patches from the MinGW-w64 project's MinGW-Builds releases. Also, a 32-bit GDB is now available, and both 32-bit and 64-bit GDB automatically load GCC's libstdc++ "pretty printers", if available, to provide more readable debugging output for libstdc++ objects. See the README files included in the core and gdb packages for details on all local patches.

Please make sure to read the Quirks page for more information about the differences between TDM-GCC and other GCC toolchains.

http://tdm-gcc.tdragon.net/quirks

-----------------------------------------------------------------------------------------------------------------

主要区别:

Static runtime linkage (libgcc & friends)
  • TDM-GCC doesn't link your programs with the libgcc or libstdc++ runtime DLLs by default.
  • Other toolchains default to DLL runtime linkage in order to allow you to throw exceptions among DLLs and EXEs.
  • TDM-GCC lets you throw exceptions among DLLs and EXEs even with the static runtime.
  • Your programs will not rely on any additional DLLs when compiling with default options.
  • TDM-GCC still includes DLL versions of the libgcc and libstdc++ runtimes, which you can enable for your program with "-shared-libgcc" and "-shared-libstdc++" if desired.

http://tdm-gcc.tdragon.net/quirks

原文地址:https://www.cnblogs.com/findumars/p/8290061.html