Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Build opencv windows for android

Hello ! I come to you since I have building problems to put opencv and opencv-contrib in my android project ( i'am on windows 10). I followed the following tutorial and I have errors at the cmake stage. ( https://zami0xzami.wordpress.com/2016/03/17/building-opencv-for-android-from-source/ )

I've been through a lot of forums that have guided me to add options, here is exactly the procedure I do to get the error.

cmake-gui

I press the Configure button, I select MinGW makefiles and when it's finished I press the Generate button. Then, I open a Mingw console ( I tried the latest version and version 5.3.0), I go to the folder where there are the build files and I type the following command:

mingw32-make -j4

And finally I have this error :

[ 9%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_sse2.c.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c: In function 'realize_virt_arrays': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: error: 'SIZE_MAX' undeclared (first use in this function) if (SIZE_MAX - maximum_space < new_space)

and this :

[ 10%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/once.cc.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char, const char)': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared return ::_wfopen(wpath.c_str(), wmode.c_str());

and the compilation ends on that :

[ 13%] Built target libwebp Makefile:161: recipe for target 'all' failed mingw32-make: * [all] Error 2

Can you please help me?

Build opencv windows for android

Hello ! I come to you since I have building problems to put opencv and opencv-contrib in my android project ( i'am on windows 10). I followed the following tutorial and I have errors at the cmake stage. ( https://zami0xzami.wordpress.com/2016/03/17/building-opencv-for-android-from-source/ )

I've been through a lot of forums that have guided me to add options, here is exactly the procedure I do to get the error.

cmake-gui

I press the Configure button, I select MinGW makefiles and when it's finished I press the Generate button. Then, I open a Mingw console ( I tried the latest version and version 5.3.0), I go to the folder where there are the build files and I type the following command:

mingw32-make -j4

And finally I have this error :

[ 9%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_sse2.c.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c: In function 'realize_virt_arrays': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: error: 'SIZE_MAX' undeclared (first use in this function) if (SIZE_MAX - maximum_space < new_space)

and this :

[ 10%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/once.cc.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char, const char)': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared return ::_wfopen(wpath.c_str(), wmode.c_str());

and the compilation make ends on that :

[ 13%] Built target libwebp Makefile:161: recipe for target 'all' failed mingw32-make: * [all] Error 2

Can you please help me?

Build opencv windows for android

Hello ! I come to you since I have building problems to put opencv and opencv-contrib in my android project ( i'am on windows 10). I followed the following tutorial and I have errors at the cmake stage. ( https://zami0xzami.wordpress.com/2016/03/17/building-opencv-for-android-from-source/ )

I've been through a lot of forums that have guided me to add options, here is exactly the procedure I do to get the error.

cmake-gui

I press the Configure button, I select MinGW makefiles and when it's finished I press the Generate button. Then, I open a Mingw console ( I tried the latest version and version 5.3.0), I go to the folder where there are the build files and I type the following command:

mingw32-make -j4

And finally I have this error :

[ 9%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_sse2.c.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c: In function 'realize_virt_arrays': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\libjpeg-turbo\src\jmemmgr.c:662:11: error: 'SIZE_MAX' undeclared (first use 'strcpy_s' was not d[ 44%] eclared in this function) scope Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.obj if (SIZE_MAX - maximum_space < new_space)strcpy_s( szKey, 1024, icvWindowPosRootKey )

and this :

[ 10%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/once.cc.obj C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char, const char)': C:\Users\Marvyn\Documents\opencv build\opencv-4.0.1\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared return ::_wfopen(wpath.c_str(), wmode.c_str());

and the make ends on that :

[ 13%] Built target libwebp Makefile:161: recipe for target 'all' failed mingw32-make: * [all] Error 2

Can you please help me?

Build opencv windows for android

Hello ! I come to you since I have building problems to put opencv and opencv-contrib in my android project ( i'am on windows 10). I followed the following tutorial and I have errors at the cmake stage. ( https://zami0xzami.wordpress.com/2016/03/17/building-opencv-for-android-from-source/ )

I've been through a lot of forums that have guided me to add options, here is exactly the procedure I do to get the error.

cmake-gui

I press the Configure button, I select MinGW makefiles and when it's finished I press the Generate button. Then, I open a Mingw console ( I tried the latest version and version 5.3.0), I go to the folder where there are the build files and I type the following command:

mingw32-make -j4

And finally I have this error :

'strcpy_s' was not d[ 44%] eclared in this scope Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.obj strcpy_s( szKey, 1024, icvWindowPosRootKey )

Build opencv windows for android

Hello ! I come to you since I have building problems to put opencv and opencv-contrib in my android project ( i'am on windows 10). I followed the following tutorial and I have errors at the cmake stage. ( https://zami0xzami.wordpress.com/2016/03/17/building-opencv-for-android-from-source/ )

I've been through a lot of forums that have guided me to add options, here is exactly the procedure I do to get the error.

cmake-gui

I press the Configure button, I select MinGW makefiles and when it's finished I press the Generate button. Then, I open a Mingw console ( I tried the latest version and version 5.3.0), I go to the folder where there are the build files and I type the following command:

mingw32-make -j4

And finally I have this error :

'strcpy_s' was not d[ 44%] eclared in this scope Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.obj strcpy_s( szKey, 1024, icvWindowPosRootKey )C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp:175:14: error: 'thread' in namespace 'std' does not name a type std::thread second_workthread; ^~~~~~ C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp:176:14: error: 'mutex' in namespace 'std' does not name a type std::mutex mtx; ^~~~~ C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp:177:14: error: 'condition_variable' in namespace 'std' does not name a type std::condition_variable objectDetectorRun; ^~~~~~~~~~~~~~~~~~ C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp:178:14: error: 'condition_variable' in namespace 'std' does not name a type std::condition_variable objectDetectorThreadStartStop; ^~~~~~~~~~~~~~~~~~ C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp: In member function 'void cv::DetectionBasedTracker::SeparateDetectionWork::setParameters(const cv::DetectionBasedTracker::Parameters&)': C:\Users\Marvyn\Documents\opencv build\opencv-3.4.5\modules\objdetect\src\detection_based_tracker.cpp:143:30: error: 'mutex' is not a member of 'std' std::unique_lock<std::mutex> mtx_lock(mtx);