From 06b3c0bd646026df4ec06ef14a8b5afbf66ca98b Mon Sep 17 00:00:00 2001 From: murmur Date: Thu, 7 Nov 2024 14:44:17 +0800 Subject: [PATCH] =?UTF-8?q?CSSC-PC=E6=9B=B4=E6=96=B0=E4=BA=861=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具/VSCODE/gcc编译.md | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 工具/VSCODE/gcc编译.md diff --git a/工具/VSCODE/gcc编译.md b/工具/VSCODE/gcc编译.md new file mode 100644 index 0000000..4bfd404 --- /dev/null +++ b/工具/VSCODE/gcc编译.md @@ -0,0 +1,62 @@ +--- +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" + +} +``` +` \ No newline at end of file