我刚刚发现了隐藏的宝石crtdbg.h
,它使内存泄漏检测变得更加容易。不幸的是,当我今天将 DirectX 链接到我的程序时,我遇到了一些我以前从未见过的错误。
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.h(425): error C2059: syntax error : 'constant'
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.h(425): error C2091: function returns function
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.h(425): error C2802: static member 'operator new' has no formal parameters
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.h(426): error C2059: syntax error : 'constant'
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.h(426): error C2090: function returns array
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.inl(1003): error C2761: 'void *(__cdecl *_D3DXMATRIXA16::operator new(void))(size_t)' : member function redeclaration not allowed
1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\d3dx10math.inl(1003): fatal error C1903: unable to recover from previous error(s); stopping compilation
似乎当 crtdbg 覆盖 new 运算符时,它破坏了 DirectX SDK 中的某些内容(如果您没有注意到错误,我正在使用 DirectX 11 SDK)。有这样的记录吗?几次搜索没有产生任何结果。我真的希望我可以继续使用这些内存调试工具,任何解决方法都将不胜感激!