471,119 Members | 1,499 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

_CrtDumpMemoryLeaks and <valarray>

Hi,

I want to track memory leaks in my application (that is using <valarray>).
I used the following code:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

But then, when I include <valarray> the compiler raises the following errors :

c:\[...].NET 2003\Vc7\include\valarray(367) : warning C4003: not enough
actual parameters for macro 'free'
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(427) : see reference to class
template instantiation 'std::valarray<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1124) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=size_t
]
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1333) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=std::_Bool
]
c:\[...].NET 2003\Vc7\include\valarray(1335) : see reference to
class template instantiation 'std::mask_array<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\DEV\mySoft\src\converTools\converTypes.h(85) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=double
]

It appeared with use of _CRTDBG_MAP_ALLOC macro and I think it leads to a
replacement of the free member-function in std::valarray class by the
debug-purpose defined free macro.

But I can't see how I should use those two elements correctly

Thanks

Dack
Nov 17 '05 #1
1 2408
Dack wrote:
Hi,

I want to track memory leaks in my application (that is using <valarray>).
I used the following code:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

But then, when I include <valarray> the compiler raises the following errors :

c:\[...].NET 2003\Vc7\include\valarray(367) : warning C4003: not enough
actual parameters for macro 'free'
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(427) : see reference to class
template instantiation 'std::valarray<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1124) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=size_t
]
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1333) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=std::_Bool
]
c:\[...].NET 2003\Vc7\include\valarray(1335) : see reference to
class template instantiation 'std::mask_array<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\DEV\mySoft\src\converTools\converTypes.h(85) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=double
]

It appeared with use of _CRTDBG_MAP_ALLOC macro and I think it leads to a
replacement of the free member-function in std::valarray class by the
debug-purpose defined free macro.

But I can't see how I should use those two elements correctly


#include <valarray> before the other stuff.

Tom
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jim West | last post: by
11 posts views Thread by Charles L | last post: by
1 post views Thread by Busin | last post: by
2 posts views Thread by Steven T. Hatton | last post: by
43 posts views Thread by john | last post: by
1 post views Thread by Alex Vinokur | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.