平時寫 C/C++ 小程序的時候,不喜歡開VS,太龐大了,還要建項目。對於小程序,一個能夠進行單文件編譯的 IDE 是個人首選,我用的是 C-Free 5.0,內置編譯器 MinGW,Windows 版 GCC。html
前幾在 C-Free 5.0 上寫排序程序,想看一下大概的執行時間,因而用 C 標準庫函數 clock() ,結果包含的 time.h 頭文件一直不能經過編譯。把源代碼複製到 VS 2008 裏竟然順利編譯經過,猜測這應該是編譯器 MinGW 的問題,忍忍吧。c++
前天把系統搞得一踏糟,無奈之下還原,今天找了個最新版的 MinGW 編譯器,沒想到 time.h 頭文件的問題沒了,爽。web
其實我用的不是 MinGW 官方版,而是另外一個發行版本 TDM-GCC,目前最新版 4.5.2,一下翻譯一段介紹:小程序
TDM-GCC是一個 Windows 版的編譯器套件。
它結合了 GCC 工具集中最新的穩定發行版本,包括了自由並開源的 MinGW 或 MinGW-w64 的運行時 APIs,以此建立一個 LIBRE 來替代微軟的編譯器及其平臺 SDK。
它能夠建立自 Windows 95 以來任何 Windows 操做系統版本之上的 32 位或 64 位的二進制文件。ide
提供一個下載地址:http://tdm-gcc.tdragon.net/函數
另外在某博客上有下面一段話:工具
TDM (Twilight Dragon Media) 和 MinGW官方沒有任何瓜葛。TDM中包的版本通常比MinGW官方版新,彷佛有MinGW的成員也在用TDM版。力挺這個的人彷佛也挺多。ui
TDM GCC 分兩個版本(異常處理方式不一樣)spa
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
-----------------------------------------------------------------------------------------------------------------
主要區別:
http://tdm-gcc.tdragon.net/quirks