在Visual Studio代码中处理CMake项目时,如何使用CIN 我试图使用VisualStudio代码(在Windows上)在C++项目上使用基本CI/CUT。该项目是使用CMake设置的。所有内容都正确构建,使用COUT在VSC中调试时,我可以显示文本。但当我尝试CIN时,程序挂起,输入无法传递给程序

在Visual Studio代码中处理CMake项目时,如何使用CIN 我试图使用VisualStudio代码(在Windows上)在C++项目上使用基本CI/CUT。该项目是使用CMake设置的。所有内容都正确构建,使用COUT在VSC中调试时,我可以显示文本。但当我尝试CIN时,程序挂起,输入无法传递给程序,c++,visual-studio-code,cmake,C++,Visual Studio Code,Cmake,从VS2019 CIN的开发者命令提示符运行该程序可以正常工作 c_cpp_properties.json { "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBU

从VS2019 CIN的开发者命令提示符运行该程序可以正常工作

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.18362.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "intelliSenseMode": "msvc-x64",
            "configurationProvider": "vector-of-bool.cmake-tools",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json"
        }
    ],
    "version": 4
}
settings.json

{
    "C_Cpp.configurationWarnings": "Disabled",
    "files.associations": {
        "algorithm": "cpp",
        "atomic": "cpp",
        "cctype": "cpp",
        "chrono": "cpp",
        "cmath": "cpp",
        "condition_variable": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        < ... omitted to make the question readable ... >
        "xstddef": "cpp",
        "xstring": "cpp",
        "xtr1common": "cpp",
        "xtree": "cpp",
        "xutility": "cpp"
    }
}
{
“C_Cpp.configurationWarnings”:“已禁用”,
“文件.关联”:{
“算法”:“cpp”,
“原子”:“cpp”,
“cctype”:“cpp”,
“chrono”:“cpp”,
“cmath”:“cpp”,
“条件变量”:“cpp”,
“cstddef”:“cpp”,
“cstdint”:“cpp”,
“cstdio”:“cpp”,
“cstdlib”:“cpp”,
“cstring”:“cpp”,
<…省略以使问题可读…>
“xstddef”:“cpp”,
“xstring”:“cpp”,
“xtr1common”:“cpp”,
“xtree”:“cpp”,
“xutility”:“cpp”
}
}

欢迎来到Stackoverflow!您不需要选项“cppStandard”:“c++11”?我认为你使用<代码>标准>代码>如果你在C中寻找代码,但是对于C++,你会使用<代码> CPPPTalm < /C>…谢谢你的热情欢迎!当我使用VSC的模板设置项目时,它没有添加字段。我添加了它(“cppStandard”:“c++11”,并得到了相同的结果。