私の例外クラスには、複数の引数 (...) を持つコンストラクターがあります。これは Windows では正常に動作しますが、Linux では正常にコンパイルされますが、リンクを拒否します。
これが Linux で動作しないのはなぜですか?
以下に例を示します。
class gcException
{
public:
gcException()
{
//code here
}
gcException(uint32 errId, const char* format = NULL, ...)
{
//code here
}
}
enum
{
ERR_BADCURLHANDLE,
};
.
編集
だから私はそれを次のように呼び出すと:
if(!m_pCurlHandle)
throw gcException(ERR_BADCURLHANDLE);
次のコンパイル エラーが発生します。
error: no matching function for call to ‘gcException::gcException(gcException)’
candidates are: gcException::gcException(const gcException*)
gcException::gcException(gcException*)
gcException::gcException(gcException&)