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 .
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?
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.