【问题标题】:Trouble with installing wxwidgets 2安装 wxwidgets 2 的问题
【发布时间】:2016-02-25 02:18:22
【问题描述】:

如果您看到我的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

【问题讨论】:

  • 它明确地告诉你错误。在您输出的第三行,它说您的编译器不支持 C++ 2011。启用该支持或升级您的编译器。
  • 如何运行支持c++ 2011?
  • 错误信息告诉你如何启用它。它可能看起来像乱码,但您应该非常仔细地阅读编译器警告和错误。
  • 我不明白我必须做什么,我看到了这个 -std=gnu++11,接下来呢?
  • 您必须在编译项目时调用编译器时添加该选项。您必须查看您的 makefile 以查看编译器选项的设置位置。

标签: c++ gcc compiler-errors wxwidgets


【解决方案1】:

不幸的是,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 构建应用程序时使用相同的标志!

【讨论】:

    猜你喜欢
    • 2016-02-24
    • 2014-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-19
    • 1970-01-01
    • 1970-01-01
    • 2013-06-19
    相关资源
    最近更新 更多