2

我正在编译一个使用sigc++. 它失败并出现此错误:

In file included from /opt/local/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:7:
/opt/local/include/sigc++-2.0/sigc++/functors/functor_trait.h:17:1: error: declaration of anonymous struct must be a definition
struct nil;

有问题的代码是:

              namespace sigc {

              /** nil struct type.
               * The nil struct type is used as default template argument in the
               * unnumbered sigc::signal and sigc::slot templates.
               *
               * @ingroup signal
               * @ingroup slot
               */
              #ifndef DOXYGEN_SHOULD_SKIP_THIS
error here -> struct nil;
              #else
              struct nil {};
              #endif

我想不通的是为什么编译器认为它是一个匿名结构。有问题的行不只是一个前向声明吗?

4

0 回答 0