VSCode + CMakeList
生活随笔
收集整理的這篇文章主要介紹了
VSCode + CMakeList
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、下載安裝VSCode
2、配置CMakeList可以執行文件,格式如下
3、設置配置launch.json(選擇左邊的小之主,然后生成新的json的文件,選擇c++(GDB/LLDB),然后就會自動生成launch.json文件,把"program": "enter program name, for example ${workspaceFolder}/a.out"改成你的可執行文件,如下所示),
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "(gdb) Launch","type": "cppdbg","request": "launch","program": "${workspaceFolder}/build/project","args": [],"stopAtEntry": false,"cwd": "${fileDirname}","environment": [],"externalConsole": false,"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true}]}] }4、編譯ctrl+shift+p,選擇cmake build編譯選擇gcc編譯器,然后就可以生成可執行文件
然后F5就可以調試了。
總結
以上是生活随笔為你收集整理的VSCode + CMakeList的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 公开课|“隐私计算+区块链”安全解锁数据
- 下一篇: python接口自动化测试的两种思路