Eclipse CDT 代码完成问题

发布于 2024-11-24 03:26:47 字数 90 浏览 1 评论 0原文

由于某种原因,我正在运行的 Eclipse CDT(在 Ubuntu Linux 中)的代码完成无法正常工作。每次我添加一个库时,都不会弹出任何内容。这有什么原因吗?

For some reason the code completion for the Eclipse CDT I'm running (in Ubuntu linux) isn't working properly. Every time I include a library nothing pops up. Is there any reason why this could be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

决绝 2024-12-01 03:27:02

在源代码中包含标头是不够的。您需要告诉索引器在哪里查找标头。为此,您需要转到项目的属性,导航到C/C++ General > >路径和符号 项目。在 Includes 选项卡中,添加包含 GNU C++ 语言标头的文件夹。如果您的库需要,您可能还需要在 Symbols 选项卡中定义一些符号。

现在您只需等待索引器完成它的工作,自动完成功能就会开始工作。请记住,索引器并不完美,复杂的 C++ 头文件(例如 STL)很容易将其混淆。

Including a header in your source code is not enough. You need to tell the indexer where to look for the header. To do so, you need to go to your project's properties, navigate to the C/C++ General > Paths and Symbols item. In the Includes tab, add the folder containing your headers for the GNU C++ language. You may also need to define a few symbols in the Symbols tab if your library needs it.

Now you'll just have to wait for the indexer to do it's thing and auto-completion should start working. Keep in mind that the indexer isn't perfect and complicated C++ headers like the STL can confuse it pretty easily.

冷夜 2024-12-01 03:27:02

也许是因为它找不到标题。您必须在项目工具设置的“包含”部分中指定包含路径。其他方法可能会阻止 Eclipse 找到标头,即使 gcc 可以找到它们。

Maybe because it cannot find the headers. You have to specify the include paths in the Includes section of your tool settings for the project. Other method's may prevent eclipse from finding the headers even when gcc can find them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文