我正在告訴我錯誤 - 「拋出不同的異常」,在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