我正在告诉我错误 - “抛出不同的异常”,在C++
error: declaration of 'virtual FXHost::~FXHost()' throws different exceptions
error: than previous declaration 'virtual FXHost::~FXHost() throw()'
我不知道如何开始解决这个错误,我以前从来没有遇到过这种。
在我的.h我:
public:
virtual ~FXHost() throw();
在我的.cpp我:
FXHost::~FXHost()
{
gHost = NULL;
}
指针赞赏。
不要从析构函数中抛出异常! http://stackoverflow.com/questions/130117/throwing-exceptions-out-of-a-destructor – nos 2010-08-13 00:31:06
你的头声明函数不抛出异常,但你的定义不 – 2010-08-13 00:31:50
@nos我认为这就是他正在尝试用他的投掷() – 2010-08-13 00:33:25