Visual Studio Code 属性控制台不允许错误

Reh*_*ziz 4 c visual-studio-code

我是编程新手,我正在做一本书中的一些问题。并且被困在这个关于三角形面积的问题中。“不允许使用属性控制台”。这是由于 math.h 吗?因为相同的代码在 online-gdb 上功能齐全。

图像显示的错误

这是 lauch.json 的内容

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "externalTerminal",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

Roh*_*hou 5

代替

"console": "externalTerminal"
Run Code Online (Sandbox Code Playgroud)

"externalConsole": true
Run Code Online (Sandbox Code Playgroud)

此版本的自动生成的 launch.json 似乎不支持“控制台”属性。但是,这可以帮助我摆脱警告消息。

  • 尝试 `"externalConsole": true,` 给了我类似的警告:`不允许使用 Property externalConsole。` (6认同)