vscode无法跳转到定义怎么办

小编给大家分享一下vscode无法跳转到定义怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

1、打开VsCode: 文件 -> 将工作区另存为,,将文件夹添加到工作区。

2、按快捷键Ctrl+P,之后点击Edit configurations,打开c_cpp_properties.json文件,检查 "includePath" 字段。。

如:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/Keil_v5/ARM/ARMCC/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\\\Program Files\\\\LLVM\\\\bin\\\\clang.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

如果添加了其它路径 "C:/Keil_v5/ARM/ARMCC/include" 就会造成无法跳转,最后只能改成:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\\\Program Files\\\\LLVM\\\\bin\\\\clang.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

Ctrl+左键,F12都可以跳转。

vscode无法跳转到定义怎么办

以上是“vscode无法跳转到定义怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!