首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >crtdbg.h是否与DirectX冲突?

crtdbg.h是否与DirectX冲突?
EN

Stack Overflow用户
提问于 2012-06-10 22:29:03
回答 1查看 565关注 0票数 1

我刚刚发现了隐藏的gem crtdbg.h,它使内存泄漏检测变得更容易。不幸的是,当我今天将DirectX链接到我的程序中时,我得到了一些以前从未见过的错误。

代码语言:javascript
运行
复制
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

似乎当DirectX覆盖了新的操作符时,它破坏了crtdbg SDK中的一些东西(如果你没有注意到错误,我正在使用crtdbg 11sdk)。是否有类似于此的文档?一些搜索没有得到任何结果。我真的希望我能继续使用这些内存调试工具,任何解决办法都会非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2012-06-11 03:22:30

好了,我想通了。我找到了this post via Google. (我希望Stack Overflow在我输入这段代码的时候在侧边栏上显示了它!)也许它确实发生了,但我错过了……)。

基本上,我需要将crtdbg.hstdlib.h的包含和_CRTDBG_MAP_ALLOC的定义移动到一个单独的头中,并使用项目属性页中C/C++ >>高级下的Forced Include File选项强制到处都包含文件。这似乎使它覆盖了所有其他new覆盖。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10969502

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档