下載安裝MinGW
下載后只是個(gè)安裝器,需要在線下載真正的安裝內(nèi)容
[mingw](https://sourceforge.net/projects/mingw/?source=typ_redirect)
開始安裝

Paste_Image.png
默認(rèn)安裝在C:/mingw目錄下

Paste_Image.png
點(diǎn)擊continue,
選擇安裝組件,這里我們要使用的是c/c++編譯器,其他的按個(gè)人需要,勾選后選擇apply
等待下載安裝完成
添加環(huán)境變量
我的電腦,屬性,高級系統(tǒng)設(shè)置,系統(tǒng)變量,將C:\MINGW\bin路徑添加到‘path'

Paste_Image.png
點(diǎn)擊確定,完成設(shè)置
打開cmd窗口,輸入gcc -v

Paste_Image.png
至此,gcc編譯器安裝完成并成功添加到環(huán)境變量
命令行編譯c程序
helloworld小程序

Paste_Image.png
g++ helllo.c -o hello 編譯,此時(shí)桌面生成了hello.exe可執(zhí)行文件

Paste_Image.png
sublime設(shè)置
打開sublime,Tools,build systems,選擇c++ single file
ctrl+B

Paste_Image.png