在 MinGW 5.3.0 中,“mutex”不是“std”的成员

2023-11-24

我正在使用 MinGW 5.3.0 和 Crypto++ 5.6.5:

C:\MinGW>g++ -std=c++11 -s -D_WIN32_WINNT=0x0501 LOG.cpp -U__STRICT_ANSI__ Decclass.cpp \
-IC:\\MinGW\\ -IC:\\MinGW\\boost -LC:\\MinGW  -lssl -lcrypto -lcryptopp -lgdi32 -lPCRYPT \
 -lz -ltiny -lwsock32 -lws2_32 -lShlwapi

编译结果出现以下错误。

c:\mingw\cryptopp565\include\cryptopp\misc.h:287:14: error: 'mutex' in namespace 'std'
does not name a typestatic std::mutex s_mutex;

c:\mingw\cryptopp565\include\cryptopp\misc.h:296:18: error: 'mutex' is not a member of
'std'std::lock_guard<std::mutex> lock(s_mutex);

enter image description here

它显示“mutex”不是“std”的成员

我需要另一个版本的 MinGW 吗? 或者我可以自行修复这个构建吗?


我通过编辑解决了这个问题"misc.h"在路径“cryptopp565\include\cryptopp\misc.h”中

在...上面misc.h我包括了互斥体.hpp from 升压库

#include "c:\mingw\include\boost\asio\detail\mutex.hpp"

我也从std to 升压::asio::详细信息

static std::mutex s_mutex; 
static boost::asio::detail::mutex s_mutex;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 MinGW 5.3.0 中,“mutex”不是“std”的成员 的相关文章

随机推荐