1掂咒、下載安裝cmake 官網(wǎng)下載 命令行安裝
ref https://blog.csdn.net/qq_34980490/article/details/110389433
2、vscode 安裝插件 c/c++, c++ Intellisense ,cmake ,cmake tools
ref http://www.reibang.com/p/7b84a4dc1ad0
3、VScode 設置cmake 路徑
進入首選項 -> 設置 添加CMake 路徑 “cmake.cmakePath”: “自己CMake的路徑” 我的是:
“cmake.cmakePath”: “/Applications/CMake.app/Contents/bin/cmake”
ref https://blog.csdn.net/qq_34980490/article/details/110389433
4逊桦、創(chuàng)建調(diào)試代碼 hello world
ref http://www.reibang.com/p/7b84a4dc1ad0
5哥蔚、進行vscode 設置
Command + Shift + P岩调,輸入CMake:Configure得滤,回車。
ref http://www.reibang.com/p/7b84a4dc1ad0
5.1 bug [cmake] Error opening terminal: unknown.
解決: 使用 vim ~/.bash_profile 設置環(huán)境變量 export TERM=xterm 然后重啟vscode
ref https://bbs.archlinux.org/viewtopic.php?id=94780
ref http://www.reibang.com/p/8e51bc9cebfa
6 設置tasks.json launch.json
ref https://blog.csdn.net/wanzew/article/details/83097457
6.1 problem
solve change MIMode from gdb to lldb (or install other gdb and set MIDebuggerPath as warning say)俯艰。
7 good job捡遍!