installing OpenCV in windows 10 using TDM 64 bit and Codeblocks fails

asked 2018-06-13 11:24:38 -0600

Hello,

I am trying to configure opencv 'opencv-3.4.1-vc14_vc15.exe' on my CodeBlocks 17.12 through this tutorial: https://zahidhasan.github.io/2017-03-...

When I open CMake and make all required setups, I tried configure CodeBlocks - MinGW MakeFiles. After a few seconds I got this error:

CMake Error at C:/CMake/share/cmake-3.11/Modules/CMakeMinGWFindMake.cmake:12 (message): sh.exe was found in your PATH, here:

C:/Users/Mikael/Anaconda3/Library/usr/bin/sh.exe

For MinGW make to work correctly sh.exe must NOT be in your path.

Run cmake from a shell that does not have sh.exe in your PATH.

If you want to use a UNIX shell, then use MSYS Makefiles.

Call Stack (most recent call first): CMakeLists.txt:127 (project)

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage Configuring incomplete, errors occurred!

Of course, I can try delete sh.exe from my path. I am worried about my Python/Anaconda and unexpected consequences as well. Is any possibility to get working both in the same time ? Currently I am coding the most time in python. But I'm forced to consider using c / c ++ for better performance.

I have tried ignoring this problem and just try generate again. Failed logs(otherwise others fine): Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Failed Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Failed Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed Performing Test HAVE_C_WNO_SHORTEN_64_TO_32 Performing Test HAVE_C_WNO_SHORTEN_64_TO_32 - Failed Looking for dlfcn.h Looking for dlfcn.h - not found Check size of INT8 Check size of INT8 - failed Check size of INT16 Check size of INT16 - failed Check size of INT32 Check size of INT32 - failed Performing Test HAVE_C_WNO_MISLEADING_INDENTATION Performing Test HAVE_C_WNO_MISLEADING_INDENTATION - Failed Performing Test HAVE_C_WNO_POINTER_COMPARE Performing Test HAVE_C_WNO_POINTER_COMPARE - Failed Performing Test HAVE_C_WNO_ABSOLUTE_VALUE Performing Test HAVE_C_WNO_ABSOLUTE_VALUE - Failed Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Failed Could not find OpenBLAS include. Turning OpenBLAS_FOUND off Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Failed Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Failed Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Failed Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed

After all, i tried build it from codeblocks and got this: build log: C:\opencv\sources\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:94:3: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat] return s == nullptr || s == 0; ^ C:\opencv\sources\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'bool google::protobuf::internal::win32::{anonymous}::null_or_empty(const char_type)': C:\opencv\sources\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:94:15: error: 'nullptr' was not declared in this scope return s == nullptr || s == 0; ^ mingw32-make.exe[2]: [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj] Error 1 mingw32-make.exe[1]: [3rdparty ... (more)

edit retag flag offensive close merge delete

Comments

For MinGW make to work correctly sh.exe must NOT be in your path

use cmake-gui, and just clear that line

If you want to use a UNIX shell, then use MSYS Makefiles.

oh, no. NEVER use msys, it will eat up all your pathes

'nullptr' is a keyword in C++11

your compiler does not know c++11 "out-of-the-box". it's probably too old. you can try to add -std=c++11 to the CMAKE_CXX_FLAGS , but if that does not work, consider upgrading to latest mingw64

Anaconda

seems entirely broken, use an "ordinary" python instead. and whatever libs it finds there, they're incompatible to the rest of the world.

berak gravatar imageberak ( 2018-06-13 11:34:34 -0600 )edit

further on, you need:

 -D ENABLE_PRECOMPILED_HEADERS=OFF
 -D WITH_IPP=OFF
 -D WITH_TBB=OFF
 -D WITH_MSMF=OFF
berak gravatar imageberak ( 2018-06-13 11:38:59 -0600 )edit