【问题标题】:Error "is_enum not declared in this scope" when trying to compile my wxWidgets program尝试编译我的 wxWidgets 程序时出现错误“is_enum not declared in this scope”
【发布时间】:2016-09-15 14:54:18
【问题描述】:

当我尝试编译时,G++ 编译器显示以下错误:

C:\wx\include\wx\strvararg.h|350|error: 'is_enum' in namespace 'std' does not name a template type|
C:\wx\include\wx\strvararg.h|354|error: 'is_enum' was not declared in this scope|
C:\wx\include\wx\strvararg.h|354|error: template argument 1 is invalid|

我为此使用 Code::Blocks,并使用 wxWidgets 的非整体 DLL 构建。

感谢您的帮助!

【问题讨论】:

  • 听起来你没有启用 C++11。
  • 抛出异常。打印编译错误。
  • 如何启用 c++11?

标签: c++ compiler-errors codeblocks wxwidgets


【解决方案1】:

正如 Brian 已经指出的,您应该启用 C++11。如您所见What are the differences between -std=c++11 and -std=gnu++11?,有两种方法可以做到这一点。

我记得,在编译整个 wxWidgets 库时,我使用了 -std=gnu++11 并且没有任何问题。

【讨论】:

【解决方案2】:

只是添加到macroland评论:

您应该考虑升级到 gcc 版本 5.2+。此版本确实具有完整的 c++11 功能集,而以前的版本具有部分功能。

【讨论】:

    猜你喜欢
    • 2014-03-29
    • 2022-06-16
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多