Search code examples
c++compiler-errorscodeblockswxwidgets

Error "is_enum not declared in this scope" when trying to compile my wxWidgets program


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!


Solution

  • 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.