我使用cmake和 mingw-w64 在 windows 10 上进行 opencv ,但是,当它在97%时使用时出现错误。 有错误报告:
[ 96%] Built target opencv_videostab
[ 97%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj
In file included from C:/PROGRA~1/Python36/include/Python.h:8:0,
from D:\Program Files (x86)\OpenCv_3.2.0\opencv\sources\modules\python\src2\cv2.cpp:6:
C:/PROGRA~1/Python36/include/pyconfig.h:379:5: warning: "_MSC_VER" is not defined, evaluates to 0 [-Wundef]
#if _MSC_VER >= 1800
^~~~~~~~
In file included from D:/Program Files (x86)/MinGw_64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/math.h: 36:0,
from C:/PROGRA~1/Python36/include/pyport.h:194,
from C:/PROGRA~1/Python36/include/Python.h:50,
from D:\Program Files (x86)\OpenCv_3.2.0\opencv\sources\modules\python\src2\cv2.cpp:6:
D:/Program Files (x86)/MinGw_64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/cmath:42:10: fatal error: D:/ Program Files (x86)/MinGw_64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/bits/cpp_type_traits.h>: Invalid argument
#include <bits/cpp_type_traits.h>s
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
mingw32-make[2]: ***[modules\python3\CMakeFiles\opencv_python3.dir\build.make:180: modules/python3/CMakeFiles/ope ncv_python3.dir/__/src2/cv2.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:6794: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
mingw32-make: *** [Makefile:160: all] Error 2
我该怎么做才能解决它?
更新: 我已经解决了它,这是一个错误的错误,错误的错误
:cmath:42:10: fatal error: D:/ Program Files (x86)/MinGw_64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/bits/cpp_type_traits.h>: Invalid argument #include <bits/cpp_type_traits.h>s
说头文件有错误,所以我只是删除&#39; s&#39;在include语句之后,即include <bits/cpp_type_traits.h>