Ask Your Question

Difficulty building OpenCV with MinGW

asked 2019-08-18 10:17:11 -0500

JoeP gravatar image

updated 2019-08-19 04:19:47 -0500

I'm trying to build OpenCV 4.1.1 with MinGW32 from the source (in Windows 10 and for C++). I've been following the instructions at the bottom of this page: and at the top of this page: So far I've successfully cloned the source, but when I press "configure" in CMake I get several errors: "Could not find openBLAS include","A library with LAPACK API not found"

The only option I had changed was to enable "ENABLE_SOLUTION_FOLDERS" as instructed in the first link. CMake still allowed me to continue and "generate", however then when I typed "mingw32-make" into the command prompt it gave me more significant errors at about 20%: "Error: 'mutex' in namespace 'std' does not have a type"

I then disabled openexr as this seemed to be the source of the error and tried again, but it didn't get much further: "Error: '::_wfopen' has not been declared"

I don't know whether they are to do with the warnings I was getting in CMake, or whether it's something else. What should I do now?

edit retag flag offensive close merge delete


Please insert in your post all messages as text

LBerger gravatar imageLBerger ( 2019-08-18 11:48:54 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-08-19 08:45:06 -0500

The first errors are actually no errors, but debug info output. The system basically says that you want LAPACK and BLAS, but that it is not installed on your systems and thus those supports are dropped. If it is on your system, point cmake gui to the correct location first before hitting configure.

Same for most of your other errors.

If cmake is not able to find libraries, it is because they are not installed on the default paths and thus you will have to point cmake to the correct location manually.

edit flag offensive delete link more


Can I get away with not including those packages? If so, how can I get rid of the command line errors? If not, where do I get the missing packages (shouldn't they be installed automatically with OpenCV?)? Thanks

JoeP gravatar imageJoeP ( 2019-08-20 07:17:17 -0500 )edit

BLAS and LAPACK are optimizations, so not manditory to get the library to work. I do not know which packages provide them for windows, in linux a simple install of liblapack and libblas solves these issues. But it seems they do exist: lapack windows and BLAS windows.

StevenPuttemans gravatar imageStevenPuttemans ( 2019-08-20 07:47:37 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-18 10:17:11 -0500

Seen: 68 times

Last updated: Aug 19