Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ajay_S_
Beginner
90 Views

getting errors while using tbb library

hello ,
I have built a library(say MYLIB) in which i have used tbb to paralleize. This  MYLIB i am trying to use for one application i am building and when i try to build the application getting following erros :

/usr/include/tbb/internal/_concurrent_unordered_impl.h:146:85: error:   expected a type, got ‘397’
/usr/include/tbb/internal/_concurrent_unordered_impl.h:146:85: error: template argument 2 is invalid
/usr/include/tbb/internal/_concurrent_unordered_impl.h:146:90: error: ‘bool tbb::interface5::internal::operator!=(const int&, const int&)’ must have an argument of class or enumerated type
     friend bool operator!=( const solist_iterator<M,T>& i, const solist_iterator<M,U>& j );

can anyone please help , i am new to tbb .

0 Kudos
4 Replies
90 Views

Hi, Ajay,

When I have seen this kind of message it is usually because a preprocessor symbol has collided with a typename or variable name.  Do you have M, T or U predefined somewhere?

 

Best Regards,

Chris

Ajay_S_
Beginner
90 Views

Hi Mr. Chris
Many Thanks for your kind reply .
Yeah I do had a macro M declared.. :)

RafSchietekat
Black Belt
90 Views

Always use a distinctive prefix, or otherwise carefully #undef after local use, and only use macros for things that cannot be done in the underlying language itself (C++ already has provisions for constants and inline function templates etc.).

Unfortunately that simplistic preprocessor is all we have for light-weight code generation, so you have to be quite careful how you use it. People already get hysterical about macros even when you use them responsibly (in my view), so it's best not to give them any reasons.

 

 

Ajay_S_
Beginner
90 Views

Thanks a lot Mr. Raf and Christopher for your prompt suggestions ,
that solved the problem for me :)

Reply