Chào các bạn, mình hiện đang làm một số bài tập trên C++ cần OpenCV, mình có theo hướng dẫn cài MinGW CMake và OpenCV.
Nhưng sau khi thực thi câu lệnh mingw32-make
mình chạy được 2% thì bị lỗi sau:
C:\C++ Work\opencv-mingw>mingw32-make
[ 2%] Built target zlib
[ 2%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jmemmgr.c.obj
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c: In function 'realize_virt_arrays':
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: error: 'SIZE_MAX' undeclared (first use in this function)
if (SIZE_MAX - maximum_space < new_space)
^~~~~~~~
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c:39:1:
+#include <stdint.h>
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11:
if (SIZE_MAX - maximum_space < new_space)
^~~~~~~~
C:\C++ Work\opencv\sources\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: note: each undeclared identifier is reported only once for each function it appears in3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\build.make:678: recipe for target '3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jmemmgr.c.obj' failed
mingw32-make[2]: *** [3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jmemmgr.c.obj] Error 1
CMakeFiles\Makefile2:312: recipe for target '3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/all' failed
mingw32-make[1]: *** [3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Mọi người cho mình hỏi nguyên nhân và cách khắc phục lỗi này được không ? Cảm ơn mọi người.