1. 安装vscode

随手记_ubuntu下配置vscode+cmake c++开发环境

2.安装vscode的c++拓展 如下3个

随手记_ubuntu下配置vscode+cmake c++开发环境

3. 打开项目,点击三角形 debug按钮,在 launch.json中 配置 调试器(gdb)、输出项目名称(program)、命令行参数(args)

随手记_ubuntu下配置vscode+cmake c++开发环境

4. 点击cmake按钮,进入cmake子界面,点云 配置(方框左箭头)、编译(下箭头)

随手记_ubuntu下配置vscode+cmake c++开发环境

5. 点击三角形,进入debug界面,进行调试

(记得CMakeList.txt中先要设置好调试模式 set( CMAKE_BUILD_TYPE debug ) ,断点处才会停下来

随手记_ubuntu下配置vscode+cmake c++开发环境

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2021-10-19
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
猜你喜欢
  • 2022-01-11
  • 2020-03-26
  • 2022-02-08
  • 2021-04-27
  • 2021-05-19
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案