C++ 安装wxwidgets 2时出现问题

C++ 安装wxwidgets 2时出现问题,c++,gcc,compiler-errors,wxwidgets,C++,Gcc,Compiler Errors,Wxwidgets,如果你看到了我的问题,如果你也遇到了问题,你必须看看这个问题并阅读答案 让我们开始吧,在删除无用的gcc路径后,我在控制台中得到了以下内容: from ../../src/common/any.cpp:18: C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/bits/c++0x_warning.h:32:2: error : #error This file requires compiler and library support for the

如果你看到了我的问题,如果你也遇到了问题,你必须看看这个问题并阅读答案 让我们开始吧,在删除无用的gcc路径后,我在控制台中得到了以下内容:

from ../../src/common/any.cpp:18:
C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/bits/c++0x_warning.h:32:2: error
: #error This file requires compiler and library support for the ISO C++ 2011 st
andard. This support is currently experimental, and must be enabled with the -st
d=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from ..\..\include/wx/string.h:46:0,
                 from ..\..\include/wx/any.h:19,
                 from ../../src/common/any.cpp:18:
..\..\include/wx/strvararg.h:350:18: error: 'is_enum' in namespace 'std' does no
t name a template type
     typedef std::is_enum<T> is_enum;
                  ^
..\..\include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this s
cope
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                      ^
..\..\include/wx/strvararg.h:354:68: error: template argument 1 is invalid
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                                    ^
makefile.gcc:11712: recipe for target 'gcc_mswud\baselib_any.o' failed
mingw32-make: *** [gcc_mswud\baselib_any.o] Error 1

C:\wxWidgets-3.0.2\build\msw>
这是命令

cd %WXWIN%\build\msw
mingw32-make -f makefile.gcc clean
>>>mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1 WXUNIV=0<<<
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=0 UNICODE=1 WXUNIV=0

不幸的是,wxWidgets 3.0.2在g++5.1之前发布,甚至在g++4.9之前发布,或者可能接近g++4.9,因此在使用它时,它不会在C++98模式下进行开箱即用的编译。此问题已在之后修复,但未在正式版本中修复,因此您有2个选择:

适用于你的来源。如果你不确定怎么做,最好的办法就是从git的WX_3_0_分支获取最新的源代码。 通过在make命令行中附加cxflags=-std=gnu++11,以C++11模式构建。如果这样做,请记住在以后使用wxWidgets构建应用程序时使用相同的标志!
它明确地告诉你错误。在输出的第三行上,它表示编译器不支持C++ 2011。要么启用支持或升级编译器,如何运行支持C++ 2011?错误消息告诉您如何启用它。它可能看起来像胡言乱语,但您应该仔细阅读编译器警告和错误。我不明白我必须做什么,我看到了这个-std=gnu++11,接下来该怎么办?您必须在编译项目时调用编译器时添加该选项。您必须查看makefile以查看编译器选项的设置位置。