当前位置: 代码迷 >> 综合 >> c++:ISO C++ forbids declaration of ‘xxx’ with no type
  详细解决方案

c++:ISO C++ forbids declaration of ‘xxx’ with no type

热度:14   发布时间:2024-02-20 04:07:06.0

这种情况一般发生在你的类声明的函数体与实现类的函数体名字不一致

如:

声明:

class spi{public:spi();~spi();
}         

   实现:

spi:spl(){    //这里spi写成了spl}
spi:~spi(){}

仔细检查一下声明与实现的原型是否一致

  相关解决方案