Page 3 of 3

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

Posted: Sun Apr 02, 2017 5:53 am
by palacs
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.

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

Posted: Sun Apr 02, 2017 8:32 am
by catalin
palacs wrote:What about the C++11 parts?
Which parts are those?
wxW does not use new features from c++11.

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

Posted: Wed Apr 05, 2017 8:29 am
by palacs
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.

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

Posted: Wed Apr 05, 2017 9:21 am
by catalin
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.

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

Posted: Wed Apr 05, 2017 9:36 am
by doublemax
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.

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

Posted: Wed Apr 05, 2017 10:30 am
by catalin
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.

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

Posted: Wed Apr 05, 2017 1:03 pm
by PB
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

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

Posted: Wed Apr 05, 2017 2:17 pm
by ONEEYEMAN
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.