当前位置:   article > 正文

vscode编译和调试wsl环境的c语言程序

vscode编译和调试wsl环境的c语言程序

直接f5会报错,提示你改一下json文件
launch.json
{
“version”: “0.2.0”,
“configurations”: [
{
“name”: “(gdb) Launch”,
“type”: “cppdbg”,
“request”: “launch”,
“program”: “ w o r k s p a c e F o l d e r / a . o u t " , " a r g s " : [ ] , " s t o p A t E n t r y " : f a l s e , " c w d " : " {workspaceFolder}/a.out", "args": [], "stopAtEntry": false, "cwd": " workspaceFolder/a.out","args":[],"stopAtEntry":false,"cwd":"{workspaceFolder}”,
“environment”: [],
“externalConsole”: false,
“MIMode”: “gdb”,
“setupCommands”: [
{
“description”: “Enable pretty-printing for gdb”,
“text”: “-enable-pretty-printing”,
“ignoreFailures”: true
}
],
“preLaunchTask”: “build”,
“miDebuggerPath”: “/usr/bin/gdb”
}
]
}

task.json
{
“version”: “2.0.0”,
“tasks”: [
{
“label”: “build”,
“type”: “shell”,
“command”: “gcc”,
“args”: [
“-g”,
f i l e " , " − o " , " {file}", "-o", " file","o","{fileDirname}/ f i l e B a s e n a m e N o E x t e n s i o n . o u t " ] , " g r o u p " : " k i n d " : " b u i l d " , " i s D e f a u l t " : t r u e , " p r o b l e m M a t c h e r " : [ " {fileBasenameNoExtension}.out" ], "group": { "kind": "build", "isDefault": true }, "problemMatcher": [" fileBasenameNoExtension.out"],"group":"kind":"build","isDefault":true,"problemMatcher":["gcc”],
“detail”: “Generated task by Debugger.”
}
]
}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/651610
推荐阅读
相关标签
  

闽ICP备14008679号