6

I'm trying to complete the boost::signal tutorial at http://www.boost.org/doc/libs/1_47_0/doc/html/signals/tutorial.html#id2850736

However Eclipse CDT shows parsing errors with whichever syntax I use

I have

#include <boost/signals.hpp>

Preferred syntax

boost::signal<void (float, float)> sig;    
sig.connect(&print_sum);

Invalid template arguments at signal

Method 'connect' could not be resolved

Portable syntax

boost::signal2<float, float, float> sig;
sig.connect(&print_sum);

Method 'connect' could not be resolved

Symbol 'signal2' could not be resolved

I use eclipse 3.7

4

1 回答 1

12

这似乎是一个CDT问题。你最近更新了你的eclipse版本吗?eclipse 论坛上正在讨论该主题:

http://www.eclipse.org/forums/index.php/t/216821/

也许它会给你一些关于如何解决这个问题的灵感。

编辑:作为临时解决方法,您可以禁用某些代码分析功能和标记。为此,请转到 Window->Preferences->"C/C++"->"Code Analysis" 并禁用部分或全部问题。我已经禁用了所有,因为它仍然会突出显示在编译过程中发现的错误,而且我不会被错误声明的问题所迷惑。

于 2011-08-04T00:12:05.807 回答