c++ - 安装 wxwidgets 2 时出现问题

标签 c++ gcc compiler-errors wxwidgets

如果你看到我的trouble with installing wxwidgets 1如果您也再次遇到问题,您必须查看这个问题并阅读答案 让我们开始,删除无用的 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 个选择:

  1. 申请this fix给你的消息来源。如果您不确定如何操作,最好的选择是从 git 的 WX_3_0_BRANCH 获取最新源代码。
  2. 通过将 CXXFLAGS=-std=gnu++11 附加到 make 命令行,以 C++11 模式进行构建。如果您这样做,请记住稍后在使用 wxWidgets 构建应用程序时使用相同的标志!

关于c++ - 安装 wxwidgets 2 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33863195/

相关文章:

c++ - 如何使用结构创建链表?

c++ - 这个基础转换函数背后的逻辑是什么?

c++ - 为什么输出运算符是 'os << value' 而不是 'value >> os' ?

编译后的c程序内存地址

c++ - 结构化绑定(bind)和基于范围的;在 gcc 中抑制未使用的警告

c++ : Receiving a lot of errors. 简单继承导致大量错误

java - 如何测试树项是否是javafx中 TreeView 的根节点?

python - 如何在 C++ 中为 Cython 中的两种类型使用模板化函数?

c++ - 从外部调用静态 C 函数

delphi - 如何解码内部错误和可能的原因?