在集成终端中运行C ++

时间:2019-04-01 21:09:00

标签: visual-studio-code vscode-settings

我安装了MinGW,并将配置添加到launch.json。 当我运行c ++代码时,它将在外部cmd中打开。我尝试设置 "externalConsole": true,"externalConsole": false,,但是当我这样做时,代码将无法运行。 这是我正在使用的配置:

{
            "name": "C/C++",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/MinGW/bin/gdb.exe",
            "setupCommands": [
              {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": false
              }
            ],
            "preLaunchTask": "build & debug file"
        }

0 个答案:

没有答案