wxWidget v 3.0.2 compile errors. Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
AshtonC1
Earned some good credits
Earned some good credits
Posts: 100
Joined: Wed Feb 18, 2015 4:56 pm

wxWidget v 3.0.2 compile errors.

Post by AshtonC1 »

I'm getting a few errors after 4-5 minutes of compiling, any advice appreciated.

Using: mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

Compile log portion with errors(copied from command prompt):

Code: Select all

In file included from C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.
9.2/include/c++/type_traits:35:0,
                 from ..\..\include/wx/strvararg.h:25,
                 from ..\..\include/wx/string.h:46,
                 from ..\..\include/wx/any.h:19,
                 from ../../src/common/any.cpp:18:
C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.9.2/include/c++/bits/c
++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
   ^
In file included from ..\..\include/wx/string.h:46:0,
                 from ..\..\include/wx/any.h:19,
                 from ../../src/common/any.cpp:18:
..\..\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;
                  ^
..\..\include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this scope
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                      ^
..\..\include/wx/strvararg.h:354:68: error: template argument 1 is invalid
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                                    ^
makefile.gcc:6428: recipe for target 'gcc_mswudll\monodll_any.o' failed
mingw32-make.exe: *** [gcc_mswudll\monodll_any.o] Error 1
I'm not sure how to create a more detailed or log file, there was not a log feature listed in the compiler -options.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidget v 3.0.2 compile errors.

Post by PB »

I advise doing what the compiler suggests, i.e. compile in C++11 mode. The wxWidgets 3.02 documentation reads:
C++11 note: If you want to compile wxWidgets in C++11 mode, you currently have to use -std=gnu++11 switch as -std=c++11 disables some extensions that wxWidgets relies on. I.e. please use CXXFLAGS="-std=gnu++11".
You may also add -fno-keep-inline-dllexport to CXXFLAGS, I often see it used when people build shared monolithic.
AshtonC1
Earned some good credits
Earned some good credits
Posts: 100
Joined: Wed Feb 18, 2015 4:56 pm

Re: wxWidget v 3.0.2 compile errors.

Post by AshtonC1 »

Thanks PB.

I have my act together.
I have installed MSYS and have now properly built the wxWidget library, with the requisite CXXFLAGS="-std=gnu++11" option.

Regards
leochiaro
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Apr 28, 2017 3:36 pm

Re: wxWidget v 3.0.2 compile errors.

Post by leochiaro »

Hi, I have the same error of AshtonC1, could you explain me better how did you solve the problem?
Sorry but I've never done anything like this before, it's the first time!

Thanks
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidget v 3.0.2 compile errors.

Post by PB »

You should do what I wrote in my previous post, i.e. add the CXX flag for gnu++11, i.e, the command line would change e.g. from

Code: Select all

mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
to

Code: Select all

mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 CXXFLAGS="-std=gnu++11"
Installing MSYS is not necessary.
leochiaro
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Apr 28, 2017 3:36 pm

Re: wxWidget v 3.0.2 compile errors.

Post by leochiaro »

It works!
Thank you very much!
Post Reply