无法在Ubuntu 11.04上使用gcc 4.5编译boost :: signal教程 [英] Can not compile boost::signal tutorial using gcc 4.5 on ubuntu 11.04
问题描述
我正在尝试通过 http://www.boost.org/doc/libs/1_47_0/doc/html/signals/tutorial.html#id2850736
无论如何,Eclipse CDT都会显示我使用的任何语法的解析错误
However Eclipse CDT shows parsing errors with whichever syntax I use
我有
#include <boost/signals.hpp>
首选语法
boost::signal<void (float, float)> sig;
sig.connect(&print_sum);
信号
无法解决方法连接"
便携式语法
boost::signal2<float, float, float> sig;
sig.connect(&print_sum);
无法解决方法连接"
Method 'connect' could not be resolved
符号"signal2"无法解析
Symbol 'signal2' could not be resolved
我使用eclipse 3.7
I use eclipse 3.7
推荐答案
这似乎是CDT问题.您最近是否更新了Eclipse版本? eclipse论坛中正在进行关于该主题的讨论:
It seems to be a CDT issue. Have you updated your eclipse version lately? There is a discussion on that topic in the eclipse forum going on:
http://www.eclipse.org/forums/index.php/t/216821/
也许它给您一些有关如何解决该问题的启发.
Maybe it gives you some inspiration on how to work around that problem.
作为临时替代方法,您可以禁用某些代码分析功能和标记.为此,请转到窗口"->首选项"->"C/C ++"->代码分析",并禁用部分或全部问题.我已禁用所有功能,因为它仍会突出显示在编译过程中发现的错误,并且不会因错误声明的问题而感到困惑.
As a temporary work around, you can disable certain code analysis features and markers. To do so, go to Window->Preferences->"C/C++"->"Code Analysis" and disable some or all problems. I have disabled all, since it will still highlight errors found during the compilation and I will not be confused by falsely declared problems.
这篇关于无法在Ubuntu 11.04上使用gcc 4.5编译boost :: signal教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!