我想我们可能大多已被清除MinGW的/ C++ 11的问题在Commit e4cef84883b2。你应该从主工作或执行git pull
,并取消在config.h
: 65的定义CRYPTOPP_NO_CXX11
(左右):
// Define CRYPTOPP_NO_CXX11 to avoid C++11 related features shown at the
// end of this file. Some compilers and standard C++ headers advertise C++11
// but they are really just C++03 with some additional C++11 headers and
// non-conforming classes. You might also consider `-std=c++03` or
// `-std=gnu++03`, but they are required options when building the library
// and all programs. CRYPTOPP_NO_CXX11 is probably easier to manage but it may
// cause -Wterminate warnings under GCC. MSVC++ has a similar warning.
// Also see https://github.com/weidai11/cryptopp/issues/529
// #define CRYPTOPP_NO_CXX11 1
我认为问题是,你打与Windows和它缺乏适当的C问题++ 11支持,但是你正在间接获取它们。它们是间接的,因为MinGW和GCC位于顶层。 MinGW和GCC不可能提供C++ 11,因为底层平台不能。
我认为你最好的选择就是定义CRYPTOPP_NO_CXX11
。我不认为我们可以像在Windows上那样为你做,因为我们需要访问的定义隐藏在MinGW和GCC后面。而且我们也有一些MSVC++的bug来解决问题。
下面是我们如何做到这一点在Windows上,但我们并没有获得在MinGW的这些定义(从config.h
:950):
// Dynamic Initialization and Destruction with Concurrency ("Magic Statics")
// MS at VS2015 with Vista (19.00); GCC at 4.3; LLVM Clang at 2.9; Apple Clang at 4.0; Intel 11.1; SunCC 5.13.
// Microsoft's implementation only works for Vista and above, so its further
// limited. http://connect.microsoft.com/VisualStudio/feedback/details/1789709
#if (CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \
(__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_DYNAMIC_INIT 1
#endif // Dynamic Initialization compilers
如果定义CRYPTOPP_NO_CXX11
,那么下面将不被定义并且您将避免这些问题:CRYPTOPP_CXX11_DYNAMIC_INIT
,CRYPTOPP_CXX11_SYNCHRONIZATION
和CRYPTOPP_CXX11_ATOMICS
。
来源
2017-11-06 15:42:42
jww
请不要将文字作为图片发布,而改为发布文字。 – Jonas
@Jonas谢谢... –
你是否包含'互斥'? – taskinoor