Building Opencv-3.2.0 failed on my Windows 8.1 VM, using cmake 3.5.2 and visual studio 2013:
First, Visual Studio fails without showing any helpful message, but after digging I found out cmake/cl2cpp.cmake
crashes every time. I fixed it by changing this line:
string(REGEX REPLACE "/\\*([^*]/|\\*[^/]|[^*/])*\\*/" "" lines "${lines}") # multiline comments
to:
string(REGEX REPLACE "/\\*[^\n]*\n" "" lines "${lines}") # multiline comments
string(REGEX REPLACE "[^\n]+\\*/\n" "" lines "${lines}") # multiline comments
But ok, that could be a CMake bug. After that, I'm getting the following errors:
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(554): error C2065: 'SYSTEM_INFO' : undeclared identifier
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(554): error C2146: syntax error : missing ';' before identifier 'sysinfo'
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(554): error C2065: 'sysinfo' : undeclared identifier
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(558): error C2065: 'sysinfo' : undeclared identifier
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(558): error C3861: 'GetSystemInfo': identifier not found
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(561): error C2065: 'sysinfo' : undeclared identifier
7>E:\src\Components\opencv\src\opencv\modules\core\src\parallel.cpp(561): error C2228: left of '.dwNumberOfProcessors' must have class/struct/union
7> type is 'unknown-type'
The code it is referring to in parallel.cpp
:
#if defined WIN32 || defined _WIN32
SYSTEM_INFO sysinfo;
And at the top of that file,
#if defined WIN32 || defined WINCE
#include <windows.h>
This error is fixed by checking for _WIN32 as well:
#if defined WIN32 || defined _WIN32 || defined WINCE
#include <windows.h>
I finally got the whole build to succeed after adding || defined _WIN32
to a bunch of cpp files.
My question basically is: am I doing something wrong or is this a bug that should be reported?