Ask Your Question

supersushi's profile - activity

2017-01-18 21:28:59 -0600 commented question Build Opencv 3.2 fails on Windows 8.1 with VS2013

Yes I have got Windows Kit. Otherwise it wouldn't have worked when I added || defined _WIN32.

2017-01-17 17:37:05 -0600 received badge  Editor (source)
2017-01-17 17:35:22 -0600 commented question Build Opencv 3.2 fails on Windows 8.1 with VS2013

Thanks, @LBerger. I tried a clean build (deleted everything in the build tree) but the problems remain.

Due to the high number of possible combinations, what works for the buildbot might not work for me. I'm probably using a different version of cmake, I'm using TBB, CUDA, I'm disabling a bunch of stuff. See my edit in the post.

So clearly my problem is that WIN32 is not defined. I can see it in visual studio because the code inside the #ifdef is greyed out. Any ideas? Thanks for your help.

2017-01-16 17:18:05 -0600 asked a question Build Opencv 3.2 fails on Windows 8.1 with VS2013

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?

EDIT: My build command is:

'cmake.exe', '-G', 'Visual Studio 12 Win64',
'-DBUILD_WITH_STATIC_CRT=OFF',
'-DBUILD_SHARED_LIBS=ON',
'-DCMAKE_CXX_FLAGS=/MP',
'-DCMAKE_C_FLAGS=/MP'
'-DWITH_1394=OFF',
'-DWITH_FFMPEG=OFF',
'-DWITH_EIGEN=ON',
'-DWITH_OPENCL=ON',
'-DWITH_CUDA=ON',
'-DWITH_IPP=ON',
'-DWITH_TBB=ON',
'-DWITH_TIFF=ON',
'-DWITH_OPENCL=ON',
'-DBUILD_TBB=OFF',
'-DBUILD_opencv_apps=OFF',
'-DBUILD_DOCS=OFF',
'-DBUILD_PERF_TESTS=OFF',
'-DBUILD_TESTS=OFF',
'-DBUILD_ZLIB=OFF',
'-DENABLE_SSE41=ON',
'-DENABLE_AVX2=OFF',
'-DTBB_INCLUDE_DIR=.../include',
'-DCUDA_TOOLKIT_ROOT_DIR=...',
'-DINSTALL_CREATE_DISTRIB=OFF',
'-DBUILD_opencv_world=OFF'