codeblocks win 安装和使用

时间:2021-08-22 18:17:33

1.下载 win10版本的codeblocks安装包
https://jaist.dl.sourceforge.net/project/codeblocks/Binaries/17.12/Windows/codeblocks-17.12mingw-setup.exe
注意要选择codeblocks-16.01mingw-setup.exe,这是带编译器的,如果你下载其他的版本很有可能会发现你只能编辑不能编译
2.安装codeblocks
双击codeblocks-16.01mingw-setup.exe可执行文件开始安装,基本上是一路next和yes即可
软件一般默认路径是:C:\Program Files (x86)\CodeBlocks
3.卸载codeblocks
codeblocks提供了自带的卸载程序,打开你的安装目录(比如C:\Program Files (x86)\CodeBlocks),你可以看到uninstall.exe卸载程序,双击运行既可以轻松卸载codeblocks软件

4.入门教程:创建工程-编译-调试
请求助万能的搜索引擎搜索关键字”codeblocks入门教程”,网上一堆入门资料
5.常见调试问题:
ERROR: You need to specify a debugger program in the debuggers’s settings.
(For MinGW compilers, it’s ‘gdb.exe’ (without the quotes))
(For MSVC compilers, it’s ‘cdb.exe’ (without the quotes))
参考解决方法:https://www.zybang.com/question/3b761f4958997107a4c34982d1bdc1b5.html

配置好 调试器 所在的路径
菜单选择:setting -> debugger -> default -> Excutable Path
写入 C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe

5.pthread 安装
tp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip 下载pthreads-w32库文件包
解压后得三个文件夹
Pre-built.2
pthreads.2
QueueUserAPCEx

其中Pre-built.2文件夹,发现里面有3个文件夹,dll(动态链接库)、include(头文件)、lib(静态链接库)
5.1 打开dll文件夹中的x86文件夹,将里面的所有dll文件安装到C:\Windows\SysWOW64中
5.2 打开lib文件夹中的x64文件夹,将里面的所有lib文件安装到C:\Windows\System32中