|
发表于 2020-10-30 09:51:14
|
显示全部楼层
本楼为最佳答案
本帖最后由 jitianmoshen 于 2020-10-30 09:56 编辑
项目目录里有个.vscode,里面有launch.json,task.json,也可以有settings.json
这个是launch.json,你把miDebuggerPath按照你的路径改下,我用的mingw64
- {
- "version": "0.2.0",
- "configurations": [
- {
- "name": "gcc.exe - 生成和调试活动文件",
- "type": "cppdbg",
- "request": "launch",
- "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
- "args": [],
- "stopAtEntry": false,
- "cwd": "${workspaceFolder}",
- "environment": [],
- "externalConsole": false,
- "MIMode": "gdb",
- "miDebuggerPath": "C:\\mingw64\\bin\\gdb.exe",
- "setupCommands": [
- {
- "description": "为 gdb 启用整齐打印",
- "text": "-enable-pretty-printing",
- "ignoreFailures": true
- }
- ],
- "preLaunchTask": "C/C++: gcc.exe build active file"
- }
- ]
- }
复制代码
这个是task.json
- {
- "tasks": [
- {
- "type": "shell",
- "label": "C/C++: gcc.exe build active file",
- "command": "C:\\mingw64\\bin\\gcc.exe",
- "args": [
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
- ],
- "options": {
- "cwd": "${workspaceFolder}"
- },
- "problemMatcher": [
- "$gcc"
- ],
- "group": {
- "kind": "build",
- "isDefault": true
- }
- }
- ],
- "version": "2.0.0"
- }
复制代码
下面是settings.json, 这个是我装着CLANG, 是防止CLANG报莫名其妙的错误的
- {
- "clang.diagnostic.enable": false,
- "files.associations":
- {
- "1.C": "cpp",
- "cstdio": "c"
- }
- }
复制代码
|
|