obsidian-notes/工具/VSCODE/gcc编译.md

62 lines
1.0 KiB
Markdown
Raw Normal View History

2024-11-07 06:44:17 +00:00
---
tags:
- 代码块
- 编译
---
vscode中同时编译多个源文件,`task.json`配置如下:
```json
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc.exe build active file",
            "command": "D:\\mingw64\\bin\\gcc.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g", "${workspaceFolder}\\*.c",
                "-I", "${workspaceFolder}",
                "-o", "${workspaceFolder}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}
```
`