Unable to compile boost :: signal tutorial using gcc 4.5 on ubuntu 11.04

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

However, the Eclipse CDT shows parsing errors depending on which syntax I use

I have

#include <boost/signals.hpp> 

Preferred Syntax

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

Invalid template arguments on signal

The connect method cannot be enabled.

Portable syntax

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

The connect method cannot be enabled.

The symbol "signal2" cannot be resolved

I am using eclipse 3.7

+6
source share
1 answer

This seems to be a CDT problem. Have you recently updated your version of the eclipse? This topic is discussed in the eclipse forum:

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

Perhaps this gives you some inspiration on how to get around this problem.

EDIT: As a temporary work, you can disable certain code analysis functions and markers. To do this, go to Window-> Preferences → "C / C ++" → "Code Analysis" and disable some or all of the problems. I disabled everything, since it will still highlight errors detected during compilation, and I will not confuse the falsely declared problems.

+12
source

All Articles