Error building Opencv4 with Qt5

Hello, I am encoutering an error while trying to build opencv4 with qt tools.

Here are the versions used to create the build:
Qt5.15.2 with the tools
gcc and g++ from mingw810_32

Description of the error:
in a directory set to receive the opencv build, I enter the command mingw32-make

at 96% the build stop with the error :

I am not sure what to do with the error.
I tried adding a couple of lines of code into the math.h file

#ifdef _WIN64
#define _hypot hypot
#include <cmath>

an advice I took from this post on on stackoverflow :

but the mingw32-make still stopped at 96% afterwards.

Does somebody have some advice on this problem?


can you please replace the (useless) screenshot with TEXT, thank you.

so, the error shown above is after your changes, right ?
what was it before ?


that’s 32bit output ?

On the photo, there is actually useful text. It was a windows cmd prompt terminal, I didn’t output the huge amount of logs to a file. The screenshot was convenient.

If it is an advice you are giving, I think there is a way to say it in a more friendly manner. In that case I would take it into account heartily.

(Anyway thanks for the quick reply).

After the changes the logs just changed from std::hypot to std::_hypot.

Right, it seems a 32 bit, I probably should have used the mingw810_64 tool.
I try that one, and come back to precise the new results.

it’s a low-resolution (!) screenshot of text. instead of posting that, you should always post the text it contains. that makes it accessible, indexable/searchable, and whenever it’s code, it lets other people copy and run the code.

can you imagine how many people show up here just throwing screenshots at us? or worse, literal photos of their screen?

1 Like

I click on the photo, I can read perfectly.

As I said, the log where not redirected to an output file. The compilation took hours, I don’t usually output hours of logs to a file by default.

It’s the latest openCV 4 version and the latest stable version of qt5.
Both techonologies are widely spread for the C++ community.

Yet it is a pain to compile for Qt. They are not new technologies, they have a good couple of years of existance.

can we get back to your original problem, please ?

which might be:

something in the opencv code needs ‘hypot’, but your compiler does not have this in it’s math.h ?

I cleaned everything. Compiled with the qt tool mingw810_64 (MinGW-W64-builds-4.3.5, and compiler gcc version 7.3.0). It compiled until the end.

Looks like at first, I just picked the wrong compiler.