Ogre fails to build with TBB on Linux

Description

Original reporter: Enrico

I am trying to build Ogre 1.7.2 on a Linux system with TBB 3.0 update 6. Boost is disabled for this build. The correct TBB headers and libraries are found by the cmake script. Running make gives the following build error:

[ 0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimable.cpp.o
In file included from /data/ogre_src_v1-7-2/OgreMain/include/OgrePlatform.h:31,
from /data/ogre_src_v1-7-2/OgreMain/include/OgreStableHeaders.h:38,
from /data/ogre_src_v1-7-2/OgreMain/src/OgreAnimable.cpp:28:
/data/ogre_src_v1-7-2/OgreMain/include/OgreConfig.h:144:1: warning: "OGRE_THREAD_SUPPORT" redefined
In file included from /data/ogre_src_v1-7-2/OgreMain/include/OgreConfig.h:35,
from /data/ogre_src_v1-7-2/OgreMain/include/OgrePlatform.h:31,
from /data/ogre_src_v1-7-2/OgreMain/include/OgreStableHeaders.h:38,
from /data/ogre_src_v1-7-2/OgreMain/src/OgreAnimable.cpp:28:
/data/ogre_src_v1-7-2/include/OgreBuildSettings.h:34:1: warning: this is the location of the previous definition
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:67: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:67: error: ISO C++ forbids declaration of 'recursive_mutex' with no type
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:67: error: expected ';' before '*' token
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In constructor 'Ogre::SharedPtr<T>::SharedPtr()':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:74: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In constructor 'Ogre::SharedPtr<T>::SharedPtr(Y*, Ogre::SharedPtrFreeMethod)':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:87: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:90: error: expected type-specifier before 'tbb'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:90: error: expected `;' before 'tbb'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In copy constructor 'Ogre::SharedPtr<T>::SharedPtr(const Ogre::SharedPtr<T>&)':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:98: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:101: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:101: error: expected `;' before 'ogrenameLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In constructor 'Ogre::SharedPtr<T>::SharedPtr(const Ogre::SharedPtr<Y>&)':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:129: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:132: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:132: error: expected `;' before 'ogrenameLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In member function 'void Ogre::SharedPtr<T>::bind(T*, Ogre::SharedPtrFreeMethod)':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:169: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:169: error: expected type-specifier before 'tbb'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:169: error: expected `;' before 'tbb'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:170: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:170: error: expected `;' before 'ogreAutoMutexLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In member function 'bool Ogre::SharedPtr<T>::unique() const':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:176: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:176: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:176: error: expected `;' before 'ogreAutoMutexLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In member function 'unsigned int Ogre::SharedPtr<T>::useCount() const':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:177: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:177: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:177: error: expected `;' before 'ogreAutoMutexLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In member function 'void Ogre::SharedPtr<T>::release()':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:205: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:208: error: 'tbb' has not been declared
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:208: error: expected `;' before 'ogreAutoMutexLock'
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:220: error: 'mutex' was not declared in this scope
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h: In member function 'virtual void Ogre::SharedPtr<T>::destroy()':
/data/ogre_src_v1-7-2/OgreMain/include/OgreSharedPtr.h:244: error: 'mutex' was not declared in this scope
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimable.cpp.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2

By manually including OgreThreadHeadersTBB.h and OgreThreadDefinesTBB.h will bypass the build errors and compile successfully. However, this is just a workaround and no general solution.

Original Mantis Ticket + Patch: http://www.ogre3d.org/mantis/view.php?id=425

Environment

None

Assignee

M

Reporter

Philip Allgaier

Labels

None

Components

Fix versions

Affects versions

Priority

Blocker
Configure