初识Code::Blocks

本学习笔记所使用的Code::Blocks版本是13.12。

  • 安装

    • 下载安装文件
      这里写图片描述

    • 双击下载文件codeblocks-13.12mingw-setup-TDM-GCC-481进行安装,选择默认设置即可

  • 创建项目

    • 点击File-New-Project
      这里写图片描述

    • 选择Console application,点击”Go”
      这里写图片描述

    • 点击“Next”
      这里写图片描述

    • 点击“Next”
      这里写图片描述

    • 填写创建项目的名称和项目路径
      这里写图片描述

    • 选择默认的编译器GNU GCC Compiler并点击“Finish”,完成项目创建。

  • 运行程序

    • Build : Ctrl-F9
    • Run : Ctrl-F10
    • Build and run : F9
    • Rebuild : Ctrl-F11
    • Comment : Ctrl-Shift-C
    • Uncomment : Ctrl-Shift-X

运行程序时出现如下错误提示信息:
“ConsoleCplus - Debug”: 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?! (Do you have a compiler installed?)
Goto “Settings->Compiler…->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).

解决方式:
更改编译器地址
这里写图片描述

随后程序即可正确运行
这里写图片描述

  • 程序调试

    • F5 - 设置断点
    • F8 - 开始调试
    • F7 - 下一行

    Code::Blocks在调试过程中查看变量没有VS方便,需要点击Debug-Debugging windows-Watches打开变量查看窗口

Watches

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值