windows下安裝gcc編譯環境minGW,安裝codeblocks默認安裝此編譯器。windows
windows設置,用戶變量設置include,lib;系統變量PATH添加minGW的bin路徑。ui
sourceinsight設置,添加快捷方式View->Toolbars->Toggle build toolbar;設置build project,clean build,compile files,run project。code
設置方式,options->custom commands,選擇相應命令,Run填寫mingw32-make.exe all/clean/program(本身定義的,但要和makfile文件中對應,這就是調用make命令),output選擇1,2。control選擇1。source links in output選擇,file,then line選擇(這些都是本身定義,根據含義選擇便可);編譯器
在project目錄下創建makefile就可在sourceinsight編譯程序了。如:io
all:編譯
gcc -o helloworld.exe helloworld.c變量
clean:gcc
del *.exefile
program:gc
helloworld.exe