1.安装
ubuntu
sudo apt-get install codeblocks
sudo apt-get upgrade
sudo apt install build-essential
sudo apt install valgrind
sudo apt install codeblocks-contrib
codeblocks
ok
windows
二进制下载codeblocks-16.01mingw-setup.exe
2.卸载
卸载可使用命令sudo apt-get purge
例如 sudo apt-get purge codeblocks
移除包和依赖的话可使用 sudo apt-get autoremove
例如sudo apt-get autoremove codeblocks
3.C++11标准设置
在CodeBlocks16.01编译器菜单栏,点击Settings->Compiler,打开Global compiler settings界面,将"Have g++ follow the C++11 ISO C++ language"选项打上勾,最后点击OK。
4.新建C++文件
console application
5.添加库文件
1、方法一:在CodeBlocks界面中右击工程名project,点击Add files…添加,代码中需要写#include“…”绝对路径。
2、方法二:Settings->Compiler->Global compiler settings->Search directories->Compiler,点击下方的Add按钮。
6.注释
ctrl + shift + c : 注释多行
ctrl + shift + x : 取消多行注释,当然,也可以注释一行哦
7.新建c++文件
左上角new file
项目右键add file