编译我的代码时,编译器会出现一些错误。 错误:
Error 1 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 7 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 11 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 16 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 22 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
这是标题的代码部分:
template <typename T>
inline T AtlThrow(T tLeft, T tRight)
{
T tResult;
HRESULT hr=AtlAdd(&tResult, tLeft, tRight);
if(FAILED(hr))
{
AtlThrow(hr);
}
return tResult;
}
我的问题:如何从标题中修复此错误?我是否需要安装一些关于ATL的sdk或其他东西?
答案 0 :(得分:2)
您的代码中有一些内容从编译器输入中排除AtlThrowImpl
:
<atlexcept.h>
_ATL_NO_EXCEPTIONS
_ATL_CUSTOM_THROW
__ATLEXCEPT_H__
定义了其他内容,然后加入<atlexcept.h>
AtlThrowImpl
位于atlexcept.h中,在您面前有完整的项目,您可以检查确切的冲突并排除它。