在 eclipse 中导入 autotools 项目找不到所有包含,中断自动完成

importing an autotools project in eclipse doesn't find all includes, breaks autocomplete

我有一个 autotools 项目,该项目 引用外部目录 包含 构建输出 另一个项目(headers、库等...)。 配置构建通过命令行工作正常。通过 eclipse 作为现有 autotools 项目导入后,eclipse 会找到第二个项目中 headers/references 的 none。

Eclipse 也无法找到 non-standard 系统位置中的一些 libraries/headers,例如 /opt 等...因此,自动完成,ctrl+点击,等等...在很多事情上都不起作用。

第二个项目和 non-standard 库都在 building/compiling 时被正确引用并且被 configure

正确找到

我能够在 C/C++ 构建设置中手动添加必要的路径以解决所有包含问题,但我的印象是导入 autotools 项目应该会自动找到这些引用。我的假设不正确吗?

另外请注意,我们的配置脚本需要使用 --prefix 才能知道在哪里可以找到第二个项目。第一次导入项目时,它当然会尝试在没有设置 --prefix 的情况下自动配置所有内容,但随后会失败。然后我返回并修改 eclipse 以使用适当的前缀或手动 re-run autogen 并使用 --prefix=/some/path 配置。然后re-index项目。所以此时一切都应该设置好了。

实际问题好像是这样的:

I'm able to manually add the necessary paths in the C/C++ build settings to get all of the includes resolved, but I was under the impression that importing an autotools project should automatically find these references. Am I incorrect in that assumption?

你自己的经验告诉你并非如此,尽管你之前有预期。

在 Eclipse Autotools 项目中,Autotools 构建系统用于(配置和)构建项目,而不是 Eclipse 的任何内置构建器。就组件之间存在数据流而言,它是从 Eclipse 到项目,而不是相反。分布式 Autotools 工件(Makefile.amconfigure.ac)对 Eclipse 是不透明的,除非它具有针对这些文件类型的内容突出显示 (IIRC)。通过配置项目构建的工件不仅不透明,而且会被策略忽略。