microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Undefined identifier "Callback"C/C++(20) #12955

Open hxznhf opened 1 week ago

hxznhf commented 1 week ago

Environment

Bug Summary and Steps to Reproduce

My project used the C++header file of webview2, but the "callback" symbol cannot be parsed by the intellisence . My project compiled without any errors, only the error message was incorrect.

Configuration and Logs

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${path}"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"

            ],
            "windowsSdkVersion": "10.0.22621.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++23",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

sean-mcmanus commented 1 week ago

@hxznhf Can you provide more info? Your compilation system may be using different include paths, defines, args, that what is set in your c_cpp_properties.json. If you run C/C++: Log Diagnostics you can see more info on what is being used for your IntelliSense configuration. Are you able to locate the file containing the "callback" symbol and check if the appropriate includePath or define is being set?

hxznhf commented 1 week ago

log: 20241113T102218.zip

My “include” configuration is correct, and VSCode can also jump to the callback symbol. It seems that everything is normal except for the error message that should not appear.

It seems that images cannot be uploaded here. I have attached an image information in my reply email.