vscode 怎么配置c语言和vscode工作区是什么,请另行百度 参考了许多资料,有帮助请点个赞 我的工作区设置如下 将生成exe移动到固定的文件夹,调试时打开外部终端 参考注释,复制请修改所有出现的路径为你对应的路径
{
"folders": [
{
"path": "..\\task\\helloc"
},
{
"path": "..\\task\\Ctest"
}
],
"settings": {
"files.defaultLanguage": "c",
"editor.formatOnType": true,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"C_Cpp.clang_format_sortIncludes": true,
"editor.fontSize": 16,
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.intelliSenseMode": "windows-gcc-x64",
"debug.console.fontSize": 16,
"debug.onTaskErrors": "showErrors",
"C_Cpp.clang_format_style": "Visual Studio",
"editor.quickSuggestions": true,
"editor.formatOnSave": true,
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "g++.exezlh",
"type": "cppdbg",
"request": "launch",
"program": "D:/daskzlh/task/cexe/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "D:/daskzlh/task/cexe",
"environment": [],
"externalConsole": true,
"internalConsoleOptions": "openOnFirstSessionStart",
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "zlhc",
}
]
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "zlhc",
"type": "process",
"command": "g++",
"args": [
"-g",
"${file}",
"-o",
"D:/daskzlh/task/cexe/${fileBasenameNoExtension}.exe",
"-fexec-charset=GBK"
],
"group": {
"kind": "test",
"isDefault": true
}
}
],
"presentation": {
"echo": false,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"close": true,
},
"problemMatcher": "$gcc"
}
}
不喜欢我的设置,可参考注释调整
|