這不知道當時是在哪裏找到的答案,直接就貼進去了。
問題描述
第一次安裝並使用code::blocks10.5
編寫源代碼執行時出現這樣的錯誤提示:
"ccc - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
解決原因
原因是因爲沒有制定編譯器路徑,可能是在安裝的時候沒有選擇安裝內置的編譯器。
解決方法
- 選擇”Menu”->Settings ->”Compiler and Debugger” ,然後會出現一個新的tab;
- 在這個彈出的Tab中,會顯示
Compiler flags
,Linker settings
,Search subdirectories
等等,由於界面比較小,很多Tab標籤沒有顯示出來,點擊 “>” 按鈕2-3次, 直到發現出現Toolchain executables
; - 在這個窗口中,設置
compiler settings
到你本機安裝的編譯器目錄,這個在Window是指的mingw編譯器或者cywin;
原始回答
下面是引用的原始的回答,出自哪裏記不清了,已經好幾年了,現在基本不用Code blocks了。
I encountered the same problem and solved it after a bit of tinkering…steps would be:
- goto “Menu”->Settings ->”Compiler and Debugger” -> [It will open a new Tab ]….. ->
- In this tab, you have listings like…Compiler flags, Linker settings, Search subdirectories,…… next to that is “>” button, click on the “>” button 2-3 times, till you find “Toolchain executables” in same line.
- In this window, set “compiler settings” to which ever directories your compiler is installed.
- For varification, goto lower section of tab-menu and click on location button for gcc or g++, it shoulddirectly open a new browser window and gcc /g++ is selected.
- If this is done, your code::blocks should be working