VSCODE C++ IntelliSense为替代定义找到不相关的Yocto Sysroots
vscode c++ intellisense finds unrelated yocto sysroots for alternative definitions
我正在使用VsCode附带的cpptools
,这个项目是使用yocto为嵌入式ARM开发的。对于开发,我在本地 x64 计算机上开发和测试。然后我通过yocto构建和部署。
我的问题是,我收到很多包含错误,因为 cpptools 从我的 yocto 系统根中找到了很多不同的替代包含。我将cpptools配置为使用我的本地compile_commands.json
,并且我的IncludePath
设置中也没有与yocto sysroots相关的内容。
这是我的c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/usr/include"
],
"defines": [],
"cStandard": "c11",
"cppStandard": "c++17",
"compileCommands": "/path_to/compile_commands.json",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/g++"
}
],
"version": 4
}
由于我的yocto sysroot也没有在compile_commands.json
任何地方提及,我不知道它是如何找到这些的。过去,出于对智能感知的沮丧,我在某个时候将yocto sysroots添加到IncludePath
,但正如你所看到的,它现在被删除了。在那之后,我多次重新创建了智能感知数据库,它早就应该忘记了yocto sysroots。
问题仍然存在,cpptools如何找到我的yocto sysroots,以包含这些设置?这是由于过去捕获的设置或数据库未正确删除吗?
我仍然不知道为什么 VsCode 能够看到所有这些 yocto 文件夹以获取可能的包含路径,但遵循为我解决了问题。
为了能够在 VsCode 中使用智能感知cpptools
与compile_commands.json
,您需要在路径中安装clangd
。我已经安装了clangd-9
但它没有符号链接到/usr/bin/clangd
,我想这就是 VsCode 寻找它的地方。因此,只要确保您有有效的clangd
/usr/bin/clangd
- 如果条件不相关,我应该更喜欢两个 if 语句而不是 if-else 语句吗?
- 虚假唤醒是否会解锁所有等待线程,甚至是不相关的线程?
- std::less是否应该允许在编译时比较不相关的指针?
- 0 的 2D 数组 不相关循环的破坏逻辑 - C++
- 为什么数组到指针的输出不相关
- 如何使用模板元编程在自由函数C++链接两个不相关的类
- 为什么在使用不相关的宏时会阻止 while 循环结束?
- 将积分类型的数组作为另一个不相关的积分类型的阵列进行访问的安全且符合标准的方法
- 强制转换为不相关的引用类型是否违反严格的别名规则?
- 为什么我的代码在添加不相关的代码行后工作方式不同?
- 尝试编写函数尝试从字符串中提取数字,但它返回不相关的数字
- VSCODE C++ IntelliSense为替代定义找到不相关的Yocto Sysroots
- 什么保证两个不相关的线程中的不同不相关对象没有(不可避免的)争用条件?
- 对类型 'A *' 的非常量左值引用不能绑定到不相关的类型 'std::shared_ptr<A>' 的值
- 将函数从控制台应用程序移动到共享库项目似乎会带来不相关的编译错误
- 将不相关类型的对象reinterpret_cast空类是未定义的行为吗?
- 因为一行不相关的代码,速度相差那么大
- 对于循环重新分配完全不相关的变量
- 我可以使用 boost::bind 来存储不相关的对象吗?
- C++中的神秘:函数调用行为不端只是因为存在另一个函数调用,即使它们是不相关的