I’m trying to prepare gocv for work with it. I followed their windows tutorial to install and build opencv.
But while running win_build_opencv.cmd
building fails on mingw32-make install
step with these errors:
[ 3%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
C:opencvopencv-4.9.0modulescoresrcparallel.cpp: In function 'int cv::getThreadNum()':
C:opencvopencv-4.9.0modulescoresrcparallel.cpp:804:25: error: invalid cast from type 'pthread_t' {aka 'ptw32_handle_t'} to type 'void*'
804 | return (int)(size_t)(void*)pthread_self(); // no zero-based indexing
| ^~~~~~~~~~~~~~~~~~~~~
modulescoreCMakeFilesopencv_core.dirbuild.make:1002: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed
mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
CMakeFilesMakefile2:3619: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
C:opencvopencv-4.9.0modulescoresrcparallel_impl.cpp: In constructor 'cv::WorkerThread:: WorkerThreadBuilding CXX object modules/core/CMakeFiles/opencv_core.dir/src/utils/samples.cpp.obj
(cv::ThreadPool&, unsigned int)':
C:opencvopencv-4.9.0modulescoresrcparallel_impl.cpp:218:9: error: no matching function for call to 'ptw32_handle_t::ptw32_handle_t(int)'
218 | posix_thread(0),
| ^~~~~~~~~~~~~~~
In file included from C:opencvopencv-4.9.0modulescoresrcparallel_impl.cpp:10[ 24%] :Building CXX object mo
C:/Program Files/gcc/x86_64-w64-mingw32/include/pthread.h:584:3: note: candidate: 'ptw32_handle_t::ptw32_handle_t()'
584 | } ptw32_handle_t;
| ^~~~~~~~~~~~~~
What should I do to fix this?