Author Topic: Using Code::Block and wxWidgets compile a sample created by new project guild  (Read 11092 times)

Offline danny_HC

  • Single posting newcomer
  • *
  • Posts: 2
Dear all:
My computer enviroment is win7 64-bit.
Now i already install following tools:
2.code::blocks 13.02
3.wxWidgets 3.0.2 and wxWidgets already build by mingw-w64.

But when i use code::blocks to create a new wxWidgets project, i meet following problems:
D:\wxWidgets-3.0.2\include/wx/strvararg.h:350:18: error: 'is_enum' in namespace 'std' does not name a template type
     typedef std::is_enum<T> is_enum;
D:\wxWidgets-3.0.2\include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this scope
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
D:\wxWidgets-3.0.2\include/wx/strvararg.h:354:68: error: template argument 1 is invalid
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };

Dose anyone meets above problem, can you give me some suggestion to fix these?
Sorry i am a newer programmer in this scope, thanks everybody first!!

Offline Easior Lars

  • Multiple posting newcomer
  • *
  • Posts: 44
I have tried a wxWidgets project created by project wizard of Code::Blocks and succeeded in compiling it without your problem. So, Can you give some sample codes at minimum in order to producing the mentioned errors?
« Last Edit: August 27, 2015, 10:01:01 am by Easior Lars »
Development Environments:GCC+CodeBlocks+wxWidgets
Developing Languages:Bash+Python+C/CPP+LaTeX
Developer Utils:Emacs+GIT+OpenSSH+GPG
OS:Mac OS X, Gentoo/Kali Linux/Fedora/CentOS, MS Windows

Offline danny_HC

  • Single posting newcomer
  • *
  • Posts: 2
Dear Easior:
Thanks for your reply!!
Following i will show my flow of create project step by step~
1.Select create a new project.
2.Select wxWidgets project.
3.Press Next....
4.Select wxWidgets 3.0.x and press Next...
5.Input the project title and etc, then press Next...
6.Input Author, author'email and etc. Then press Next...
7.Here in "Preferred GUI Builder", i select "wxSmith". In "Application Type" i select "Frame Based". Then press Next...
8.Input the wxWidgets Path. Then press Next...
9.Select Compiler, i select mingw64. Debug and Release i only select Debug. Then press Next...
10.Here In "wxWidgets Library Settings", i select "wxWidgets is built as a monolithic library" and "Enable unicode". And select the item "Configure Advanced Option". Press Next...
11.Finally select "GUI Mode Application". Press Finish...

above is my flow of create a new project.

But now i find out the solution.
When i build wxWidgets for win7 64-bit, i meet the same error message. And i modify a file named config.gcc in wxWidgets-3.0.2. I change the value CXXFLAGS ?=  to CXXFLAGS +=  "-std=gnu++11" and then this can build finish.

So now in Code::Blocks, i goto  Settings-->Compiler. And in below "compiler Flags" i cheched the item "Have g++ follow the C++11 ISO C++ language standard [-std=c++11]"

Then rebuild can resolve this problem. Hope can help others meet this problem.