美文网首页
CMake c++ vscode macOS

CMake c++ vscode macOS

作者: 菜鸟游侠k2 | 来源:发表于2022-08-02 16:36 被阅读0次

1、下载安装cmake 官网下载 命令行安装
ref https://blog.csdn.net/qq_34980490/article/details/110389433
2、vscode 安装插件 c/c++, c++ Intellisense ,cmake ,cmake tools
ref https://www.jianshu.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、创建调试代码 hello world
ref https://www.jianshu.com/p/7b84a4dc1ad0
5、进行vscode 设置
Command + Shift + P,输入CMake:Configure,回车。
ref https://www.jianshu.com/p/7b84a4dc1ad0
5.1 bug [cmake] Error opening terminal: unknown.
解决: 使用 vim ~/.bash_profile 设置环境变量 export TERM=xterm 然后重启vscode
ref https://bbs.archlinux.org/viewtopic.php?id=94780
ref https://www.jianshu.com/p/8e51bc9cebfa
6 设置tasks.json launch.json
ref https://blog.csdn.net/wanzew/article/details/83097457
6.1 problem

image.png

solve change MIMode from gdb to lldb (or install other gdb and set MIDebuggerPath as warning say)。
7 good job!


image.png

相关文章

网友评论

      本文标题:CMake c++ vscode macOS

      本文链接:https://www.haomeiwen.com/subject/rorjwrtx.html