Developing fast, lightweight apps for all popular and even legacy platforms

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
palacs
Knows some wx things
Knows some wx things
Posts: 45
Joined: Mon May 30, 2016 11:11 am

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by palacs » Sun Apr 02, 2017 5:53 am

What about the C++11 parts? Although I was able to compile wx 3.0.2 with MSVC 2005, I'm not sure an older compiler like MSVC 2003 would compile these parts, even if I fix the defines problem. The problem with MSVC 2005 is that it won't generate code compatible with Windows 95. This is why I should go with MSVC 2003 which completely supports Windows 95.

catalin
Moderator
Moderator
Posts: 1521
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by catalin » Sun Apr 02, 2017 8:32 am

palacs wrote:What about the C++11 parts?
Which parts are those?
wxW does not use new features from c++11.

palacs
Knows some wx things
Knows some wx things
Posts: 45
Joined: Mon May 30, 2016 11:11 am

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by palacs » Wed Apr 05, 2017 8:29 am

For those that need you to specify -std=gnu++11 at MinGW. If you don't specify this, wxW 3.0.2 won't compile.

catalin
Moderator
Moderator
Posts: 1521
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by catalin » Wed Apr 05, 2017 9:21 am

palacs wrote:For those that need you to specify -std=gnu++11 at MinGW. If you don't specify this, wxW 3.0.2 won't compile.
As already said several times before this post, none of these is true.
There is no such requirement for any wxW version.

User avatar
doublemax
Moderator
Moderator
Posts: 13985
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by doublemax » Wed Apr 05, 2017 9:36 am

catalin wrote:
palacs wrote:For those that need you to specify -std=gnu++11 at MinGW. If you don't specify this, wxW 3.0.2 won't compile.
As already said several times before this post, none of these is true.
There is no such requirement for any wxW version.
Based on my experience, this is true. I usually don't use MinGW, but when i made some tests with it, i always had to add -std=gnu++11, otherwise you'll get build errors in wxAny.
Use the source, Luke!

catalin
Moderator
Moderator
Posts: 1521
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by catalin » Wed Apr 05, 2017 10:30 am

I have just successfully built 3.1.1 master (yes, not 3.0.2, but maybe even more concludent) without any c++11 requirement using tdm32-gcc5.1.0.

If there ever was any error solved only by setting c++11 mode, then that was a bug and I'm sure it was fixed by now. Again, enforcing c++11 compliance is not required for wxWidgets libs. There are the official mailing lists and IRC channel for asking about this and getting an answer from wxW maintainers.

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

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by PB » Wed Apr 05, 2017 1:03 pm

I have just tried and wxWidgets 3.0.2 does not compile with MinGW 5.3 without specifying -std=gnu++11 in CXXFLAGS, i.e., with

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug
I ended up with

Code: Select all

g++ -c -o gcc_mswud\baselib_any.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW__
      -D_UNICODE  -I..\..\lib\gcc_lib\mswud -I..\..\include  -W -Wall -DWXBUILDI
NG -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I
..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 -DwxUSE_BASE=1   -Wno-ctor-d
tor-privacy   -MTgcc_mswud\baselib_any.o -MFgcc_mswud\baselib_any.o.d -MD -MP ..
/../src/common/any.cpp
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\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:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\c++0x_warning.h:32:2: error: #er
ror This file requires compiler and library support for the ISO C++ 2011 standar
d. 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 no
t 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 s
cope
     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:11712: recipe for target 'gcc_mswud\baselib_any.o' failed
mingw32-make: *** [gcc_mswud\baselib_any.o] Error 1
I consider this a bug that should be reported at wxTrac. As the GIT head compiled just fine using the same procedure, the bug must have been fixed there and the fix should be backported to 3.0.

Edit
The bug is actually already recorded on wxTrac including the notice about the fix not being backported yet: http://trac.wxwidgets.org/ticket/16981

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3402
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Developing fast, lightweight apps for all popular and even legacy platforms

Post by ONEEYEMAN » Wed Apr 05, 2017 2:17 pm

Hi,
As the ticket has a fix you can actually grab the code that fixes it, apply it to you copy of 3.0.2 and recompile.

Thank you.

Post Reply