Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2465 Discussions

Error while compiling TBB with MSVC with _CRTDBG_MAP_ALLOC

Popov__Maxim
Beginner
439 Views
1>H:\\Third_party_src\\Intel\\tbb30\\include\\tbb/enumerable_thread_specific.h(109) : error C2059: syntax error : 'constant'
1> H:\\Third_party_src\\Intel\\tbb30\\include\\tbb/enumerable_thread_specific.h(147) : see reference to class template instantiation 'tbb::interface6::internal::ets_base' being compiled
1>H:\\Third_party_src\\Intel\\tbb30\\include\\tbb/enumerable_thread_specific.h(109) : error C2059: syntax error : 'constant'
1> H:\\Third_party_src\\Intel\\tbb30\\include\\tbb/enumerable_thread_specific.h(229) : see reference to class template instantiation 'tbb::interface6::internal::ets_base' being compiled
1> with
1> [
1> ETS_key_type=ets_no_key
1> ]

the problem is: crtdbg.h with _CRTDBG_MAP_ALLOCdefined do:

#define free(p) _free_dbg(p, _NORMAL_BLOCK)

This define corrupts function free() inside oftbb::interface6::internal::ets_base<>

Is it possible to fix? (may be in future release)

Best Regards,

Maxim

0 Kudos
1 Reply
Alexey-Kukanov
Employee
439 Views
It seems possible - I think we can use push_macro/pop_macro pragmas that fortunately are supported by MSVC, GCC, and Intel's compiler.
0 Kudos
Reply