|

楼主 |
发表于 2020-12-29 12:08:26
|
显示全部楼层
本帖最后由 风过无痕1989 于 2020-12-29 12:17 编辑
setting.json
- {
- "terminal.integrated.shell.windows": "cmd.exe",
- "terminal.integrated.env.windows": {"CMDER_ROOT": "[C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\cmder\\vendor]"},
- "terminal.integrated.shellArgs.windows": ["/k", "[C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\cmder\\vendor\\init.bat"],
- }
复制代码
launch.json
- // launch.json
- {
- "version": "0.2.0",
- "configurations": [
- {
- "name": "gcc.exe - 生成和调试活动文件",
- "preLaunchTask": "C/C++: gcc.exe build active file", //在launch之前运行的任务名,这个名字一定要跟tasks.json中的任务名字大小写一致
- "type": "cppdbg",
- "request": "launch",
- "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",//需要运行的是当前打开文件的目录中,名字和当前文件相同,但扩展名为exe的程序
- "args": [],
- "stopAtEntry": false, // 选为true则会在打开控制台后停滞,暂时不执行程序
- "cwd": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\mingw64\\bin",
- "environment": [],
- "externalConsole": false, // 是否使用外部控制台,选false的话,我的vscode会出现错误
- "MIMode": "gdb",
- "miDebuggerPath": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\mingw64\\bin\\gdb.exe",
- "setupCommands": [
- {
- "description": "Enable pretty-printing for gdb",
- "text": "-enable-pretty-printing",
- "ignoreFailures": true
- }
- ],
- }
- ]
- }
复制代码
tasks.json
- {
- "tasks": [
- {
- "type": "shell",
- "label": "C/C++: g++.exe build active file",
- "command": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\mingw64\\bin\\g++.exe",
- "args": [
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}"
- ],
- "options": {
- "cwd": "${workspaceFolder}"
- },
- "problemMatcher": [
- "$gcc"
- ],
- "group": {
- "kind": "build",
- "isDefault": true
- }
- }
- ],
- "version": "2.0.0"
- }
复制代码
c_cpp_properties.json
- {
- "configurations": [
- {
- "name": "Win32",
- "includePath": [
- "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\mingw64",
- "C:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/mingw64/x86_64-w64-mingw32/include"
- ],
- "defines": [
- "_DEBUG",
- "UNICODE",
- "_UNICODE"
- ],
- "windowsSdkVersion": "8.1",
- "compilerPath": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\mingw64\\bin/g++.exe",
- "cStandard": "c17",
- "cppStandard": "c++17",
- "intelliSenseMode": "gcc-x64"
- }
- ],
- "version": 4
- }
复制代码 |
|