VS Code:在 browse.path 中找不到包含文件,但 IDE 在我键入时识别该名称

问题描述

我得到 Include file not found in browse.path

但是,当我输入 #include "ntrip_caster.h" 时,IDE 会看到路径。
它在列表中给出了标题,但几秒钟后显示它一旦在代码中就找不到它。如何将 VS 定向到标题所在的位置???

另请注意,这是 WSL 上的 OS Ubuntu...我不知道 WSL Ubuntu 的路径是否有问题。


我做了以下事情:没有工作...


转到文件 -> 首选项 -> VS Code 中的设置并将“C_Cpp.intelliSenseEngine”:“认”更改为“C_Cpp.intelliSenseEngine”:“标签解析器”。


//#include "ntrip_caster.h"
//#include "/home/xxx/ntrip/src/ntrip_caster.h"
//#include "../src/ntrip_caster.h"
//#include "ntrip_caster.h"
//#include "ntrip_caster.h"
//#include "${HOME}/xxx/ntrip/src/ntrip_caster.h"
#include "ntrip_caster.h"

{
    "configurations": [
        {
            "name": "Linux","includePath": [
                //"${workspaceFolder}/**","/home/xxx/ntrip/src/"
                //"${workspaceFolder}/nn"
            ],"defines": [],"compilerPath": "/usr/bin/g++",//"cStandard": "gnu17","cStandard": "c11",//"cppStandard": "gnu++14","cppStandard": "c++17",//"intelliSenseMode": "linux-gcc-x64"
            "intelliSenseMode": "gcc-x64"
            
        }
    ],"version": 4
}

{
    "tasks": [
        {
            "type": "cppbuild","label": "C/C++: g++ build active file","command": "/usr/bin/g++","args": [
                "-g",//"-I./include -std=c++11 -pthread lpthread","-std=c++11 -pthread lpthread",//"${file}",//"/home/xxx/ntrip/src/mount_point.h","/home/xxx/ntrip/src/ntrip_caster.cc",//"/home/xxx/ntrip/src/ntrip_caster.h","/home/xxx/ntrip/src/ntrip_util.cc",//"/home/xxx/ntrip/src/ntrip_util.h","/home/xxx/ntrip/examples/ntrip_caster.cc","-o","${fileDirname}/${fileBasenameNoExtension}"
            ],"options": {
                "cwd": "${workspaceFolder}"
            },"problemmatcher": [
                "$gcc"
            ],"group": {
                "kind": "build","isDefault": true
            },"detail": "Task generated by Debugger."
        }
    ],"version": "2.0.0"
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)