其他分享
首页 > 其他分享> > VSCode + MinGW

VSCode + MinGW

作者:互联网

1. 下载

VSCode下载

https://code.visualstudio.com/

插件:CMake、C/C++、Chinese(Simplified)

MinGW下载

https://zhuanlan.zhihu.com/p/76613134

https://sourceforge.net/projects/mingw-w64/

百度网盘: http://pan.baidu.com/s/1crx1s

CMake下载

https://cmake.org/download/

2. vscode配置

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "preLaunchTask": "build",
            "type": "cdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "E:/path/MinGW/bin/gdb.exe", // 这里修改GDB路径为安装的mingw64的bin下的gdb.exe路径
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true,
                }
            ]
        }]
}
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "windows": {
                "command": "gcc",
                "args": [
                    "-ggdb",
                    "\"${file}\"",
                    "--std=c99",
                    "-o",
                    "\"${fileDirname}\\${fileBasenameNoExtension}.exe\"",
                    // "-finput-charset=UTF-8",// 输入编译器文本编码 默认为UTF-8
                    // "-fexec-charset=GBK"// 编译器输出文本编码 自行选择
                ]
            }
        }
    ]
}

标签:exe,VSCode,vscode,gdb,MinGW,https,true
来源: https://www.cnblogs.com/ffopen/p/16102606.html