CodeBlocks的安装和具体配置
的有关信息介绍如下:在安装CodeBlocks时有很多新手会遇到如下的错误:
XXXX:The compiler'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
如下图这个文件即可
若不使用附带编译器的版本进行安装,后面会有很多地方需要手动配置,操作较为麻烦。
下载后双击进行安装,下图选项全部勾选
系统自动选择第一个编译器作为默认的编译器
成功完成安装
新建一个test工程
代码如下:
#include
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
按F9运行程序,正常输出结果