gpt4 book ai didi

linux - Visual Studio Code 智能感知和 includePath

转载 作者:太空狗 更新时间:2023-10-29 11:49:23 26 4
gpt4 key购买 nike

我在 Linux 上使用带有 C/C++ 扩展的最新版本的 Visual Studio Code。我试图弄清楚为什么它在查找我的包含文件时遇到问题。

在一个 .c 文件中,它显示以下内容:

#include "tournament.h"
#include "layout.h"
#include "random.h"
#include "paytable.h"
#include "widgets.h"
#include "sound.h"
#include "leaderboard.h"

tournament.hsound.h 突出显示说代码无法找到这些文件,即使它们与其他包含的文件位于同一目录中也是如此。

我已经进入 c_cpp_properties.json 并编辑了 Linux 部分并添加了包含路径目录,如下所示:

{
"name": "Linux",
"includePath": [
"/home/jnorton/build.kgisystems/src/svn/tournament/trunk",
"/usr/include/atk-1.0",
"/usr/lib64/gtk-2.0/include",
"/usr/include/glib-2.0",
"/usr/include/gtk-2.0",
"/usr/local/include",
"/usr/include",
"/usr/include/bits",
"/usr/include/c++/7",
"${workspaceRoot}",
"/usr/include/c++/7/tr1",
"/usr/include/c++/7/x86_64-redhat-linux",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/pango-1.0",
"/usr/include/cairo"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/home/jnorton/build.kgisystems/src/svn/tournament/trunk",
"/usr/include/atk-1.0",
"/usr/lib64/gtk-2.0/include",
"/usr/include/glib-2.0",
"/usr/include/gtk-2.0",
"/usr/local/include",
"/usr/include",
"/usr/include/bits",
"/usr/include/c++/7",
"${workspaceRoot}",
"/usr/include/c++/7/tr1",
"/usr/include/c++/7/x86_64-redhat-linux",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/pango-1.0",
"/usr/include/cairo",
"/home/jnorton/build.kgisystems/src/svn/tournament/trunk"
],
"limitSymbolsToIncludedHeaders": false,
"databaseFilename": ""
}
},

我关注了 guidelines并且 Intellisense 仍然无法正常工作。

我错过了什么?

最佳答案

尝试将此行添加到 settings.json 它似乎对我有用:

"C_Cpp.intelliSenseEngine": "Tag Parser",

它似乎允许 IntelliSense 提供模糊结果。

关于linux - Visual Studio Code 智能感知和 includePath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46673355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com