Error “is_enum not declared in this scope” when tr

2019-09-26 02:34发布

The G++ compiler shows the following errors when I try to compile:

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|

I am using Code::Blocks for this, with a non-monolithic DLL build of wxWidgets.

Thanks for any help!

2条回答
劫难
2楼-- · 2019-09-26 02:50

As Brian already indicated, you should enable C++11. There are two ways of doing this as you can see What are the differences between -std=c++11 and -std=gnu++11?.

As I remember, when compiling the whole wxWidgets library, I used -std=gnu++11 and had no problems.

查看更多
仙女界的扛把子
3楼-- · 2019-09-26 02:53

Just to add to macroland comment:

You should consider upgrading to gcc version 5.2+. This version(s) does have a full set of c++11 features, whereas previous versions have them partially.

查看更多
登录 后发表回答