Eclipse Indigo 代码分析因 boost 而失败

发布于 2024-12-16 22:22:57 字数 576 浏览 5 评论 0原文

Eclipse Indigo Service Release 2 无法解析 Boost 库的 标头,因此将 boost::is_base_of 报告为未定义。特别是,这会禁用使用此类的宏扩展。

以下是演示此问题的代码示例(源代码):

在此处输入图像描述

Eclipse 在 DECLARE_TYPE(Foo, Bar) 线上抱怨错误 Symbol无法解析“is_base_of”。 Boost 包含路径被添加到项目包含路径中,并且 Eclipse 不会抱怨它。 Eclipse 不会对 boost/type_traits/is_base_of.hpp 中的任何行进行抱怨。

如何让Eclipse扩展宏?

Eclipse Indigo Service Release 2 fails to parse <boost/type_traits/is_base_of.hpp> header of Boost library and thus reports boost::is_base_of as undefined. In particular this disables macro expansion that uses this class.

Here is code sample that demonstrates this problem (source code):

enter image description here

Eclipse complains on line DECLARE_TYPE(Foo, Bar) with error Symbol 'is_base_of' could not be resolved. Boost include path is added to the project include paths and Eclipse does not complain about it. Eclipse doesn't complain on any line in boost/type_traits/is_base_of.hpp.

How to make Eclipse expand the macro?

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

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

发布评论

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

评论(1

把梦留给海 2024-12-23 22:22:57

正如 https://bugs.eclipse.org/bugs/show_bug.cgi?id=373208" 中讨论的那样id=373208 这是一个错误,但最新的夜间构建和 Juno 里程碑已修复它。问题是当前版本的 Eclipse 不支持 boost/type_traits/is_base_of.hpp 中使用的条件包含。

因此,当使用最新版本或 Juno 里程碑时,宏会正确扩展。

As discussed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=373208 this is a bug, but latest nightly build and Juno milestone have it fixed. The problem is that current release of Eclipse doesn't support conditional includes which are used in boost/type_traits/is_base_of.hpp.

Thus when using the latest build or Juno milestone -- macro is correctly expanded.

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