Page 1 of 1

Some problems with TBB + VS 2012

Posted: Fri Dec 28, 2012 1:56 pm
by noorus
Hey, compiling Ogre 1.9 with TBB on VS 2012, I came across some problems. I'll describe them here.

Firstly, Ogre's CMake won't find the latest TBB libs for Visual C++ 11. I fixed this by adding

Code: Select all

  if (MSVC_VERSION EQUAL 1700)
    set(COMPILER_PREFIX "vc11")
  endif ()
to line 63 in FindTBB.cmake, simple enough.

Secondly, nedmalloc's malloc.h header, for some ungodly reason, does this:

Code: Select all

#define _WIN32_WINNT 0x403
on line 500. This screws up TBB's _tbb_windef.h, which requires _WIN32_WINNT to be 0x0501 or newer.
I fixed this by removing the offending line from nedmalloc. No external headers, in my opinion, should ever touch the winapi version defines.

Third, OgreVolumeChunk.cpp is missing a semicolon after OGRE_THREAD_SLEEP(0) on line 256.
I fixed this by adding the semicolon there. I'm not sure if it should go to OgreThreadDefinesTBB.h instead, but at least I got Ogre compiled this way.

Re: Some problems with TBB + VS 2012

Posted: Sun Dec 30, 2012 9:55 pm
by noorus
Added to bugtracker with patch: https://ogre3d.atlassian.net/browse/OGRE-119

Re: Some problems with TBB + VS 2012

Posted: Thu Feb 07, 2013 4:31 pm
by Nodrev
I confirm that I had to remove "#define _WIN32_WINNT 0x403" too to make Ogre work with Tbb.