c++ - Does crtdbg.h conflict with DirectX? -


i discovered hidden gem crtdbg.h makes memory leak detection easier. unfortunately, when linked directx program today, got errors i've never seen before.

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 recover previous error(s); stopping compilation 

it seems when crtdbg overrides new operator, breaks in directx sdk (in case didn't notice in errors, using directx 11 sdk). documented? few searches didn't yield results. hope can continue use these memory debugging tools, , workarounds appreciated!

ok, figured out. found this post via google. (i wish stack overflow had shown me on sidebar when typing this! or maybe did , missed it...).

basically, need move including of crtdbg.h, stdlib.h , definition of _crtdbg_map_alloc separate header, , use forced include file option under c/c++ >> advanced in project properties page force include file everywhere. seems make override other new overrides.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -