解决error LNK2001: unresolved external symbol _CrtDbgReportW

工程在release64为下设置Runtime Libraty 为Multi-threaded DLL (/MD)可以编译通过,在debug64下同样的设置报如下错误:

1>CNxMediaFileInfoXML.obj : error LNK2019: unresolved external symbol __imp__CrtDbgReportW referenced in function "wchar_t * __cdecl A2WBSTR(char const *,int)" (?A2WBSTR@@YAPEA_WPEBDH@Z)
1>atlsd.lib(Allocate.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>atlsd.lib(AtlTraceModuleManager.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>atlsd.lib(Externs.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function "void __cdecl ATL::AtlThrowImpl(long)" (?AtlThrowImpl@ATL@@YAXJ@Z)
1>atlsd.lib(AtlDebugAPI.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>atlsd.lib(atlstr.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>atlsd.lib(atlbase.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>atlsd.lib(Externs.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function "void __cdecl `dynamic initializer for 'public: static class ATL::CTrace ATL::CTrace::s_trace''(void)" (??__E?s_trace@CTrace@ATL@@2V12@A@@YAXXZ)
1>atlsd.lib(AtlTraceModuleManager.obj) : error LNK2001: unresolved external symbol _CrtDbgReport
1>Debug64\NxFVMediaFileReaderInfo.dll : fatal error LNK1120: 3 unresolved externals

解决方法:在debug64下Runtime Libraty 设置为Multi-threaded Debug DLL (/MDd)即可。

展开阅读全文

没有更多推荐了,返回首页