Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
68 Views

Errors when compiling c code with tbb headers

Hi,

My project contains only C code on Linux. I've added the following line to a C file:

[bash]#include "tbb/atomic.h"[/bash] Then, I got the following error during compilation:

[bash]/opt/intel/tbb/include/tbb/atomic.h(24): catastrophic error: cannot open source file "cstddef" #include [/bash] I switched to icpc and recompiled, but now I get this:

[bash]/opt/intel/tbb/include/tbb/tbb_stddef.h(95): error #193: zero used for undefined preprocessing identifier "_WIN32" #if _WIN32||_WIN64 ^ /opt/intel/tbb/include/tbb/tbb_stddef.h(95): error #193: zero used for undefined preprocessing identifier "_WIN64" #if _WIN32||_WIN64 ^ /opt/intel/tbb/include/tbb/tbb_config.h(33): error #193: zero used for undefined preprocessing identifier "__clang__" #if __clang__ ^ /opt/intel/tbb/include/tbb/tbb_config.h(79): error #193: zero used for undefined preprocessing identifier "__MINGW32__" #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4) ^ /opt/intel/tbb/include/tbb/tbb_config.h(134): error #193: zero used for undefined preprocessing identifier "__MIC__" #if __MIC__ || __MIC2__ ^ /opt/intel/tbb/include/tbb/tbb_config.h(134): error #193: zero used for undefined preprocessing identifier "__MIC2__" #if __MIC__ || __MIC2__ ^ /opt/intel/tbb/include/tbb/tbb_config.h(145): error #193: zero used for undefined preprocessing identifier "__TBB_DEFINE_MIC" #if __TBB_DEFINE_MIC ^ [/bash] Can anyone help with this?

BTW - before compiling, I ran the following commands in order to set the environment:

[bash]source /opt/intel/bin/compilervars.sh intel64 source /opt/intel/tbb/bin/tbbvars.sh intel64[/bash]
Thanks,
Erez
0 Kudos
1 Reply
Highlighted
Employee
68 Views

TBB is C++ library. It does not support plain C excepting TBB allocator which has such a support.
0 Kudos