c++程序的 cmake编译+vscode来 debug 方法和步骤(ubuntu)

时间:2025-03-15 09:23:47

1、进行代码编译优化#debug时需要注释掉优化编译的命令

2、建立子文件夹src;include;build;CMakeLists.txt

3、写CMakeLists.txtremember!!!要写debug模式编译

4、vscode建立项目

5、debug然后使用ctrl+F5即可开始逐步的程序调试快乐debug

6、获取代码提示。(与debug无关,没有c_cpp_properties.json貌似也可以debug)

7、调试debug

8、写代码

9、code编译用CMakeLists.txt方式编译