Can't build opencv : 'recursive_mutex' in namespace 'std' does not name a type

Roy Qu <[email protected]> Sat, 26 Dec 2020 11:50:53 +0800
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <CAKjWZNVMzkL=6K84mrom3kZsXpWJu3KQt4Rj1=5CBQJAJp5+Zw@mail.gmail.com>
--===============0303744137478731167==
Content-Type: multipart/alternative; boundary="0000000000003b834205b755f372"

--0000000000003b834205b755f372
Content-Type: text/plain; charset="UTF-8"

I'm trying to build opencv using mingw gcc 9.2, and i got the following
message:

[  6%] Building CXX object
modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj
In file included from
F:\Temp\test\opencv-4.5.1\modules\core\src\precomp.hpp:49,
                 from
F:\Temp\test\opencv-4.5.1\modules\core\src\algorithm.cpp:43:
F:/Temp/test/opencv-4.5.1/modules/core/include/opencv2/core/utility.hpp:706:14:
error: 'recursive_mutex' in namespace 'std' does not name a type
  706 | typedef std::recursive_mutex Mutex;
      |              ^~~~~~~~~~~~~~~
F:/Temp/test/opencv-4.5.1/modules/core/include/opencv2/core/utility.hpp:63:1:
note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget
to '#include <mutex>'?

So what should I do to get it worked?

--0000000000003b834205b755f372
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I&#39;m trying to build opencv using mingw gcc 9.2, a=
nd i got the following message:</div><div><br></div>[ =C2=A06%] Building CX=
X object modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj<br>I=
n file included from F:\Temp\test\opencv-4.5.1\modules\core\src\precomp.hpp=
:49,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0from =
F:\Temp\test\opencv-4.5.1\modules\core\src\algorithm.cpp:43:<br>F:/Temp/tes=
t/opencv-4.5.1/modules/core/include/opencv2/core/utility.hpp:706:14: error:=
 &#39;recursive_mutex&#39; in namespace &#39;std&#39; does not name a type<=
br>=C2=A0 706 | typedef std::recursive_mutex Mutex;<br>=C2=A0 =C2=A0 =C2=A0=
 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~<br>F:/Te=
mp/test/opencv-4.5.1/modules/core/include/opencv2/core/utility.hpp:63:1: no=
te: &#39;std::recursive_mutex&#39; is defined in header &#39;&lt;mutex&gt;&=
#39;; did you forget to &#39;#include &lt;mutex&gt;&#39;?<br><div><br></div=
><div>So what should I do to get it worked?</div></div>

--0000000000003b834205b755f372--


--===============0303744137478731167==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTWluR1ctVXNl
cnMgbWFpbGluZyBsaXN0Ck1pbkdXLVVzZXJzQGxpc3RzLm9zZG4ubWUKClRoaXMgbGlzdCBvYnNl
cnZlcyB0aGUgUG9zdGluZyBFdGlxdWV0dGUsIGFzIGRlc2NyaWJlZCBhdCBodHRwczovL21pbmd3
Lm9zZG4uaW8vaW5kZXguaHRtbD9wYWdlPW1haWxpbmcuaHRtbCNsaXN0LWV0aXF1ZXR0ZS4KV2Ug
YXNrIHRoYXQgeW91IGJlIHBvbGl0ZSBhbmQgZG8gdGhlIHNhbWUuICBEaXNyZWdhcmQgZm9yIHRo
ZSBsaXN0IGV0aXF1ZXR0ZSBtYXkgY2F1c2UgeW91ciBhY2NvdW50IHRvIGJlIG1vZGVyYXRlZC4K
Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCllvdSBtYXkg
Y2hhbmdlIHlvdXIgTWluR1cgQWNjb3VudCBPcHRpb25zIG9yIHVuc3Vic2NyaWJlIGF0OgpodHRw
czovL2xpc3RzLm9zZG4ubWUvbWFpbG1hbi9saXN0aW5mby9taW5ndy11c2VycwpBbHNvOiBtYWls
dG86bWluZ3ctdXNlcnMtcmVxdWVzdEBsaXN0cy5vc2RuLm1lP3N1YmplY3Q9dW5zdWJzY3JpYmU=

--===============0303744137478731167==--