error: 'recursive_mutex' in namespace 'std' does not name a type
typedef std::recursive_mutex Mutex;
^~~~~~~~~~~~~~~
error: 'Mutex' is not a member of 'cv'
typedef std::lock_guard AutoLock;
^~
error: template argument 1 is invalid
typedef std::lock_guard AutoLock;
После попытки найти ошибку в Интернете, я попытался построить OpenCV из источника (загруженного с github) с помощью Cmake-gui и Mingw32-Make Install . К сожалению, ему не удалось построить из -за той же ошибки. < /P>
PS D:\opencv_bfs> mingw32-make install
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
[ 1%] Built target jpeg12-static
[ 2%] Built target jpeg16-static
[ 5%] Built target libjpeg-turbo
[ 7%] Built target libopenjp2
[ 7%] Built target opencv_videoio_plugins
[ 8%] Built target zlib
[ 8%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj
In file included from C:\Users\luong\Downloads\opencv-4.12.0\modules\core\src\precomp.hpp:53:0,
from C:\Users\luong\Downloads\opencv-4.12.0\modules\core\src\algorithm.cpp:43:
C:/Users/luong/Downloads/opencv-4.12.0/modules/core/include/opencv2/core/utility.hpp:788:14: error: 'recursive_mutex' in namespace 'std' does not name a type
typedef std::recursive_mutex Mutex;
^~~~~~~~~~~~~~~
C:/Users/luong/Downloads/opencv-4.12.0/modules/core/include/opencv2/core/utility.hpp:789:25: error: 'Mutex' is not a member of 'cv'
typedef std::lock_guard AutoLock;
^~
C:/Users/luong/Downloads/opencv-4.12.0/modules/core/include/opencv2/core/utility.hpp:789:25: error: 'Mutex' is not a member of 'cv'
C:/Users/luong/Downloads/opencv-4.12.0/modules/core/include/opencv2/core/utility.hpp:789:34: error: template argument 1 is invalid
typedef std::lock_guard AutoLock;
^
In file included from C:\Users\luong\Downloads\opencv-4.12.0\modules\core\src\algorithm.cpp:43:0:
C:\Users\luong\Downloads\opencv-4.12.0\modules\core\src\precomp.hpp:393:5: error: 'Mutex' in namespace 'cv' does not name a type
cv::Mutex& getInitializationMutex();
^~~~~
modules\core\CMakeFiles\opencv_core.dir\build.make:105: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj' failed
mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj] Error 1
CMakeFiles\Makefile2
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
< /code>
версия компилятора: < /p>
gcc --version
gcc.exe (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
< /code>
g++.exe (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
< /code>
cmake --version
cmake version 4.1.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
< /code>
System specification:
Edition: Windows 10 Pro
Version: 22H2
OS Build: 19045.6216
Processor Intel(R) Core(TM) i5-7440HQ CPU @ 2.80GHz 2.81 GHz
Installed RAM 24.0 GB (23.8 GB usable)
Graphics Card NVIDIA GeForce 940MX (2 GB), Intel(R) HD Graphics 630 (128 MB)
System Type 64-bit operating system, x64-based processor
Подробнее здесь: https://stackoverflow.com/questions/797 ... -namespace