云效devstudio可以选择 all in one
或者 c/c++
项目,coding必须选择 all in one
项目才行。
创建项目之后,配置好 launch.json
和 tasks.json
就可以跑了。
launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"cwd": "${fileDirname}",
"preLaunchTask": "build"
}
]
}
tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "gcc",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-g",
"-Wall",
"-static-libgcc",
"-std=c11"
]
}
]
}
配置文件参考:
https://www.bilibili.com/read/cv15814739
注意这里阿里云效devstudio跟正常的vscode好像不一样,"type": "cppdbg"
会报错,要改成 "type": "lldb"
报错:The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled.
到这里就可以调试了。阿里的使用 开始执行(不调试)
好像出不来结果。coding的没有问题,但是得去掉断点才能跑,不然还是会卡断点。
常见问题
launch.json
报错 Matches multiple schemas when only one must validate.
刷新一下浏览器即可
参考:https://blog.csdn.net/oh_futrue/article/details/104771914/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)