我在文件board.H
定义的类:问题的在C++类的定义
class Board
{
private:
...
public:
...
};
和在另一个类中,我想有一个部件是一个指向Board
对象:
#include "board.H"
class Bear
{
private:
Board* board;
...
public:
...
};
当我尝试(在Linux中使用G ++)我得到以下错误编译:
bear.H:15: error: ISO C++ forbids declaration of `Board' with no type
bear.H:15: error: expected `;' before '*' token
我在做什么错?
是您的板类定义在命名空间里? – Stormenet 2011-05-27 16:22:56
你怎么调用GCC? – 2011-05-27 16:23:34
我怀疑这个错误在于你所修剪代码的一部分。 – 2011-05-27 16:24:02