The Vscode program can run and compile but "undefined identifier" appears

Find the setting.json of the project directly, and add the following code to the outermost layer of settings.json:

 "C_Cpp.intelliSenseEngineFallback": "Disabled", //需要添加的,
 "C_Cpp.intelliSenseEngine": "Tag Parser", //  需要添加的

example

{
    
    
    "cmake.configureOnOpen": true,
    "files.associations": {
    
    
        "fstream": "cpp",
        "cstdio": "cpp",
        "iostream": "cpp"
    },
    "C_Cpp.intelliSenseEngineFallback": "Disabled", 
    "C_Cpp.intelliSenseEngine": "Tag Parser", 
}

Guess you like

Origin blog.csdn.net/LiuXF93/article/details/124177481