can't build OpenCV with TBB on windows (Bug #2497)


Added by Alexander Mordvintsev over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-10-31
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:build/install
Target version:2.4.3-rc
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

revision 468eefe0
Using MSVC 2008

Got error: tbb\internal/_tbb_windef.h(36) : fatal error C1189: #error : TBB is unable to run on old Windows versions; _WIN32_WINNT must be 0x0501 or greater.

This solves the problem, but I'm not sure if it doesn't break something else:

diff --git a/modules/core/include/opencv2/core/internal.hpp b/modules/core/include/opencv2/core/internal.hpp
index b1d8cf8..a94c61a 100644
--- a/modules/core/include/opencv2/core/internal.hpp
+++ b/modules/core/include/opencv2/core/internal.hpp
@@ -60,10 +60,10 @@
 #endif

 #if defined WIN32 || defined WINCE
+#  include <windows.h>
 #  ifndef _WIN32_WINNT         // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
 #    define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #  endif
-#  include <windows.h>
 #  undef small
 #  undef min
 #  undef max


History

Updated by Andrey Kamaev over 12 years ago

  • Target version set to 2.4.3-rc

Updated by Andrey Kamaev over 12 years ago

Fixed in fd49093 and 42471c0

  • Category set to build/install
  • Status changed from Open to Done

Also available in: Atom PDF