Skip to content

cannot find the definition of variable and the member of a struct #9355

@niliushall

Description

@niliushall

Bug type: Language Service

Describe the bug

  • OS and Version: win11, 10.0.22000, remote ubuntu20.04
  • VS Code Version: 1.67.2
  • C/C++ Extension Version: v1.10.3 / v1.9.8
  • Other extensions you installed (and if the issue persists after disabling them): c++ intellisense
  • If using SSH remote, specify OS of remote machine: ubuntu20.4
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

In the workspace, vscode can not find the definition of the variable(some can be found, some can not be found, especially in different files), and it can not identify the member of a struct though it can jump to its definition. But the code can be compiled and run normally.

The configurations as follow:
c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/src/**",
                "/usr/include/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++20",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

settings.json: none.

Screenshots

Snipaste_2022-05-24_15-35-03

Snipaste_2022-05-24_15-52-49

Snipaste_2022-05-24_15-53-20

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions