基类出现 “has incomplete type”是啥问题?
// base class
#ifndef BASE_H
#define BASE_H
class base
{
virtual void aaa()=0;
};
#endif
// derived class ==================================================
#ifndef DERIVE_H
#define DERIVE_H
class base;
class derive: public base
{
public:
derive();
virtual ~derive();
virtual void aaa();
};
#endif
//========================
#include "derive.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
derive::derive()
{
}
derive::~derive()
{
}
void derive::aaa()
{
}
出现:
-----------------------------------------
make -f Makefile.test_DEBUG ...
g++ -o derive.o -c -g derive.cpp
//xx/home/test/derive.cpp(7):
//xx/home/test/derive.h(13): error: base class `base' has incomplete type
make: *** [derive.o] Error 1
*********Make Finished*********
为什么?