对于我的异常类,我有一个具有多个参数(...)的构造函数,它在 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&)