尝试编译我的 wxWidgets 程序时出错 "is_enum not declared in this scope"
Error "is_enum not declared in this scope" when trying to compile my wxWidgets program
当我尝试编译时,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 构建。
感谢您的帮助!
正如 Brian 已经指出的那样,您应该启用 C++11。如您所见 What are the differences between -std=c++11 and -std=gnu++11?,有两种方法可以做到这一点。
我记得,在编译整个wxWidgets库时,我使用了-std=gnu++11,没有遇到任何问题。
添加到 macroland 评论:
您应该考虑升级到 gcc 版本 5.2+。此版本确实具有完整的 c++11 功能集,而以前的版本只有部分功能。
当我尝试编译时,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 构建。
感谢您的帮助!
正如 Brian 已经指出的那样,您应该启用 C++11。如您所见 What are the differences between -std=c++11 and -std=gnu++11?,有两种方法可以做到这一点。
我记得,在编译整个wxWidgets库时,我使用了-std=gnu++11,没有遇到任何问题。
添加到 macroland 评论:
您应该考虑升级到 gcc 版本 5.2+。此版本确实具有完整的 c++11 功能集,而以前的版本只有部分功能。