CodeBlocks的安装和具体配置
在安装CodeBlocks时有很多新手会遇到如下的错误:XXXX:The comp坡纠课柩iler's setup 烫喇霰嘴(GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.Probably the toolchain path within the compiler options is not setup correctly?!Goto "Settings->Compiler and debugger...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.Skipping...Nothing to be done (all items are up-to-date).这主要是由于没有正确配置GCC编译器引起的。下面介绍如何正确安装及避免此类错误。
工具/原料
codeblocks-13.12mingw-setup-TDM-GCC-481
一、下载软件
1、建议从官网上下载包含有编译器版本的CodeBlocks如下图这个文件即可
2、若不使用附带编译器的版本进行安装,后面会有很多地方需要手动配置,操作较为麻烦。
二、安装软件
1、下载后双击进行安装,下图选项全部勾选
2、系统自动选择第一个编译器作为默认的编译器
3、成功完成安装
三、测试
1、新建一个test工程
2、代码如下:#include <iostream>using namespace std;int main(){ 艘早祓胂cout << "Hello world!" << endl; return 0;}
3、按F9运行程序,正常输出结果