- 安装c++插件
- 终端里
touch main.cpp
创建main.cpp
,然后写点测试代码 - vscode里
ctr+shift+p
调出面板,搜索task
,生成tasks.json
,配置command
、args
、group
- vscode里生成
other
的launch.json
,将program
属性改为需要运行的可执行文件${workspaceRoot}/main.out
- 参考官方文档,把鼠标移到cpp文件代码的
#include
之前提示处,点击下拉菜单的Update "browse.path"
,生成c_cpp_properties.json
,后续需要包含库路径的话也是往这里面添加,如果不知道路径在哪的话,可以根据提示缺少了什么库,然后在系统里搜索一下,例如sudo find / -name stddef.h
ctrl+shift+b
编译,并且在后续的每次编辑之后、调试之前都要编译一下f5
调试
-
Notifications
You must be signed in to change notification settings - Fork 0
shyser/demo-cpp-debug-by-vscode
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
vscode下的c++开发调试配置demo
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published