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

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

Post by palacs »

I would like to develop fast, lightweight and task-oriented applications that will run on the following platforms.
  • Windows 95 (!), 98, ME, XP, Vista, 7, 8, 10
  • Linux
  • Some BSDs, at least FreeBSD
  • Mac OS X (including older, legacy PowerPC versions)
What components and features I need ...

Fast image-drawing canvas.
I need a canvas which can scroll (browse) huge images, like Google Maps, but without the bloat. I did some tests with the wxImage sample implementatin included in the wxWidgets source (samples/image). I was a bit disappointed at full-sized canvas drawing/scrolling speeds. While FLTK is able to scroll a 4K image smoothly on an 1024x768 canvas (causing ~40-50% CPU on one core), wxWidgets caused 100% CPU (on one core) and it was not smooth. It was staggering, kind of lagging. This test was done on a 800MHz x86 CPU, on both Windows XP and Windows 98. FLTK brings the same performance under Windows 98 while wxWidgets is a bit slower. So the problem: How could I create a fast-drawing canvas that is functional even on older systems (and also on UNIX/Linux/Mac)?

Fast drawing of graphical elements
The same difference I could perceive at listboxes, grids that I wrote about regarding images. FLTK performs better in this area as well. This is another problem: I need some tips and tricks how I could enhance the drawing performance of MFC.

Support for higher DPIs and therefore larger font sizes.
This is ok and this is one thing I really miss from FLTK. The sizer-based design of wxWidgets does a really good job at this field.

Native look without extra implementation.
Another thing I really miss from FLTK and wxWidgets does a really good job. Apps should have the look that is the same as others on the specific platform.

So basically I want my applications to run on hardware from Pentium I to the most recent quad-core-super-hyper-state-of-the-art processors. ;)

Any thoughts/tips on these?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

I can only talk about Windows, i don't have much experience on other platforms.
I did some tests with the wxImage sample implementatin included in the wxWidgets source (samples/image). I was a bit disappointed at full-sized canvas drawing/scrolling speeds.
How exactly did you test that? The image viewer in the image sample ("Show any imag") has no scrollbars. The main window that displays all the little images does a lot of stuff.

If you draw a devive dependend bitmap in a paint event handler you should get very close to the native speed that Windows can do. wxWidgets doesn't cause much overhead there.
The same difference I could perceive at listboxes, grids that I wrote about regarding images.
This is someone that needs to be addressed on a case-by-case basis. wxListBox is a native control, there isn't much you can do about the performance. wxGrid is a very powerful control, but slower.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
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 »

Hi,
Which version of wx did you try?
You can try to run 3.1 on Win9x. Keep in mind though that whatever you will find will not be fixed because the OS is too old, unless it is reproducible on the Vista+.
IIRC, PPC support ended with 10.5 by Apple. So if you want to support this you will have to compile you code with 2.8 latest. Once again, no support from either Apple nor wx. Apple ended the support a long time ago, and 2.8 release is about 7 years ago. That is unless you can backport fixes from 3.1/HEAD, which will be hard as hell.
10.6 support is ended with 3.0. You won't be able to compile the library with 10.6 as a minimum with 3.1 or HEAD. You will have to modify the source code to put back all the quirks there was for 10.6 and make sure that all 10.7+ features are guarded.

Of course with Linux it is much easier. Even GTK1 is still supported and it is in working condition. There is a guy that works with OpenVMS and this OS does not have GTK+2 port. So he keeps the GTK+1 port up and running. And GTK+3 is also up.

Now is it worth it? Also how well versed are you with OSX development?
Keep in mind that on OSX you will most likely have to work with Carbon port (32-bit application, Cocoa is not yet mature, ppc architecture).

That is if you don't want to compile multiple copies of the library for different architectures. And then keep them all on the download page where users will ask "What version I should download? And why the application does not work as advertised?"

Thank you.
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 »

doublemax wrote:How exactly did you test that? The image viewer in the image sample ("Show any imag") has no scrollbars. The main window that displays all the little images does a lot of stuff.
I used the wxWidgets-3.0.2/samples/image example which does have a scrollbar. You can scroll the whole canvas from top to the bottom. Its drawing performance is way below than of e.g. FLTK or native Windows (e.g. scrolling an image in Internet Explorer). Same happens at wxWidgets-3.0.2/samples/html/zip.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
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 »

palacs,
Can you try with 3.0 branch, not the release?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

I used the wxWidgets-3.0.2/samples/image example which does have a scrollbar. You can scroll the whole canvas from top to the bottom.
That's the main view which draws multiple bitmaps and some other stuff. Try "Show any image" from the menu in the image sample. (It doesn't scroll big images though, you'd have to modify it for a proper test).
Use the source, Luke!
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 »

Which compiler would you recommend for Windows 95 target?

Is it possible with MinGW or TDM-GCC?

I think somehow I should tell GCC to use the Windows API, only as much as it is present in Windows 95.

Ideas?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

After some Googling i guess that MinGW should work after setting the Windows version #defines correctly:
https://blogs.msdn.microsoft.com/oldnew ... /?p=27283/

I haven't tried it though.
Use the source, Luke!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

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

Post by PB »

palacs wrote:Which compiler would you recommend for Windows 95 target?

Is it possible with MinGW or TDM-GCC?
From http://tdm-gcc.tdragon.net/about
TDM-GCC:About wrote: It can create 32-bit OR 64-bit binaries, for any version of Windows since Windows 98.
As for MinGW, I have no idea. I believe it also depends on how the code is generated, I assume PCs running Windows95 have hardware from the last century, which may not support the CPU instructions which newer GCC compilers generate by default for both the application (should be customizable though) and the CRT your application is linked with.
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 »

@PB
Well, I think if I force CPU instructions with -march=i486 or i586, it will be fine, but it needs some testing of course.

TDM-GCC used to support Windows 95 when the project started, but there must be some kind of setting that would explicitly force the API version. I'm fine with older versions of GCC, even TDM-GCC.

@doublemaxx
Where would you put these defines the article is talking about?

... and most importantly, which wxWidgets version would you recommend for Windows 95? Would 3.0.2 (or 3.0.3) be fine with this old OS? Or should I go with 2.8.13?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

I don't use MinGW, but i guess you can pass them to the commandline as extra defines

Code: Select all

-D_WIN32_WINNT=0X501
But i just found this in one of the header files (<wxdir>/include/msw/wrapwin.h):

Code: Select all

// define _WIN32_WINNT and _WIN32_IE to the highest possible values because we
// always check for the version of installed DLLs at runtime anyway (see
// wxGetWinVersion() and wxApp::GetComCtl32Version()) unless the user really
// doesn't want to use APIs only available on later OS versions and had defined
// them to (presumably lower) values
#ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0x0600
#endif
So i'ts possible that it's not even necessary. Just give it a try.

The minimal supported Windows version for wx 3.x is Windows XP, so it might be better to use 2.8.x.
Use the source, Luke!
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 »

I did some testing with 2.8. I took a fresh clone of WX_2_8_BRANCH and tried to compile the library and the samples with three compilers. Also configured three test environments (VMware): Windows 95, XP and, Windows 7. All of them 32-bit installations. My build environment was a Windows XP SP3 Professional (32-bit).

1. I gave it a try with the latest TDM-GCC (5.1.0-3).

Code: Select all

mingw32-make -f Makefile.gcc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=0
Build succeeded (with lots of warnings). No samples did start on Windows 95, only on XP and Windows 7. This means a fail.

I retried with defining _WIN32_WINNT accordingly.

Code: Select all

mingw32-make -f Makefile.gcc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=0 CPPFLAGS+="-D_WIN32_WINNT=0x0400" 
It gave me an error.

Code: Select all

if not exist ..\..\lib\gcc_lib\msw mkdir ..\..\lib\gcc_lib\msw
if not exist ..\..\lib\gcc_lib\msw\wx mkdir ..\..\lib\gcc_lib\msw\wx
g++ -c -o gcc_msw\corelib_display.o  -O2 -mthreads  -DHAVE_W32API_H -D__WXMSW__   -DNDEBUG       -I..\..\lib\gcc_lib\msw -I..\..\include  -W -Wall -DWXBUILDING -I..\..\src\tiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_BASE=0   -Wno-ctor-dtor-privacy -D_WIN32_WINNT=0x0400  -MTgcc_msw\corelib_display.o -MFgcc_msw\corelib_display.o.d -MD -MP ../../src/msw/display.cpp
Makefile.gcc:10728: recipe for target 'gcc_msw\corelib_display.o' failed
In file included from ..\..\include/wx/defs.h:521:0,
                 from ..\..\include/wx/wxprec.h:13,
                 from ../../src/msw/display.cpp:22:
..\..\include/wx/dynarray.h: In member function 'void wxArrayShort::Remove(_wxArraywxArrayShort)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:849:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayShort, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/dynarray.h:993:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_SHORT'
 WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(short, wxArrayShort, class WXDLLIMPEXP_BASE);
 ^
..\..\include/wx/dynarray.h: In member function 'void wxArrayInt::Remove(_wxArraywxArrayInt)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:856:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayInt, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/dynarray.h:994:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_INT'
 WX_DEFINE_USER_EXPORTED_ARRAY_INT(int, wxArrayInt, class WXDLLIMPEXP_BASE);
 ^
..\..\include/wx/dynarray.h: In member function 'void wxArrayDouble::Remove(_wxArraywxArrayDouble)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:877:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayDouble, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/dynarray.h:995:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE'
 WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(double, wxArrayDouble, class WXDLLIMPEXP_BASE);
 ^
..\..\include/wx/dynarray.h: In member function 'void wxArrayLong::Remove(_wxArraywxArrayLong)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:863:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayLong, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/dynarray.h:996:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_LONG'
 WX_DEFINE_USER_EXPORTED_ARRAY_LONG(long, wxArrayLong, class WXDLLIMPEXP_BASE);
 ^
..\..\include/wx/dynarray.h: In member function 'void wxArrayPtrVoid::Remove(_wxArraywxArrayPtrVoid)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:835:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/dynarray.h:997:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_PTR'
 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE);
 ^
..\..\include/wx/buffer.h: In member function 'void wxMemoryBuffer::AppendByte(char)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:233:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK_RET(cond, msg)       wxCHECK2_MSG(cond, return, msg)
                                      ^
..\..\include/wx/buffer.h:289:9: note: in expansion of macro 'wxCHECK_RET'
         wxCHECK_RET( m_bufdata->m_data, wxT("invalid wxMemoryBuffer") );
         ^
..\..\include/wx/vector.h: In member function 'wxVectorBase& wxVectorBase::operator=(const wxVectorBase&)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:186:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK_MSG(cond, rc, msg)   wxCHECK2_MSG(cond, return rc, msg)
                                      ^
..\..\include/wx/debug.h:183:38: note: in expansion of macro 'wxCHECK_MSG'
 #define wxCHECK(cond, rc)            wxCHECK_MSG(cond, rc, NULL)
                                      ^
..\..\include/wx/vector.h:129:9: note: in expansion of macro 'wxCHECK'
         wxCHECK(copy(vb), *this);
         ^
..\..\include/wx/clntdata.h: In copy constructor 'wxClientDataDictionaryPairVector::wxClientDataDictionaryPairVector(const wxClientDataDictionaryPairVector&)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:189:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK2(cond, op)           wxCHECK2_MSG(cond, op, NULL)
                                      ^
..\..\include/wx/vector.h:148:9: note: in expansion of macro 'wxCHECK2'
         wxCHECK2(copy(c), return);\
         ^
..\..\include/wx/vector.h:158:5: note: in expansion of macro 'WX_DECLARE_VECTORBASE'
     WX_DECLARE_VECTORBASE(obj, cls)\
     ^
..\..\include/wx/clntdata.h:172:1: note: in expansion of macro '_WX_DECLARE_VECTOR'
 _WX_DECLARE_VECTOR(
 ^
..\..\include/wx/clntdata.h: In member function 'void wxClientDataDictionaryPairVector::push_back(const wxClientDataDictionaryPair&)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:189:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK2(cond, op)           wxCHECK2_MSG(cond, op, NULL)
                                      ^
..\..\include/wx/vector.h:162:9: note: in expansion of macro 'wxCHECK2'
         wxCHECK2(Alloc(size() + 1), return);\
         ^
..\..\include/wx/clntdata.h:172:1: note: in expansion of macro '_WX_DECLARE_VECTOR'
 _WX_DECLARE_VECTOR(
 ^
..\..\include/wx/event.h: In member function 'void wxCloseEvent::Veto(bool)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:233:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK_RET(cond, msg)       wxCHECK2_MSG(cond, return, msg)
                                      ^
..\..\include/wx/event.h:1409:9: note: in expansion of macro 'wxCHECK_RET'
         wxCHECK_RET( m_canVeto,
         ^
..\..\include/wx/event.h: In member function 'void wxEventTableEntryPointerArray::Remove(_wxArraywxEventTableEntryPointerArray)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:649:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class wxARRAY_DEFAULT_EXPORT)
     ^
..\..\include/wx/dynarray.h:825:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_PTR'
     WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid)
     ^
..\..\include/wx/event.h:2324:1: note: in expansion of macro 'WX_DEFINE_ARRAY_PTR'
 WX_DEFINE_ARRAY_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray);
 ^
..\..\include/wx/event.h: In function 'void wxPostEvent(wxEvtHandler*, wxEvent&)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:233:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK_RET(cond, msg)       wxCHECK2_MSG(cond, return, msg)
                                      ^
..\..\include/wx/event.h:2568:5: note: in expansion of macro 'wxCHECK_RET'
     wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") );
     ^
..\..\include/wx/datetime.h: In member function 'void wxHolidayAuthoritiesArray::Remove(_wxArraywxHolidayAuthoritiesArray)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:835:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/datetime.h:1506:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_PTR'
 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxDateTimeHolidayAuthority *,
 ^
..\..\include/wx/module.h: In member function 'void wxArrayClassInfo::Remove(_wxArraywxArrayClassInfo)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:835:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode)
     ^
..\..\include/wx/module.h:24:1: note: in expansion of macro 'WX_DEFINE_USER_EXPORTED_ARRAY_PTR'
 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxClassInfo *, wxArrayClassInfo,
 ^
..\..\include/wx/module.h: In member function 'void wxModule::AddDependency(wxClassInfo*)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/debug.h:233:38: note: in expansion of macro 'wxCHECK2_MSG'
 #define wxCHECK_RET(cond, msg)       wxCHECK2_MSG(cond, return, msg)
                                      ^
..\..\include/wx/module.h:71:9: note: in expansion of macro 'wxCHECK_RET'
         wxCHECK_RET( dep, wxT("NULL module dependency") );
         ^
../../src/msw/display.cpp: In member function 'void wxDisplayInfoArray::Remove(_wxArraywxDisplayInfoArray)':
..\..\include/wx/debug.h:194:43: warning: typedef 'wxDummyCheckInt' locally defined but not used [-Wunused-local-typedefs]
     #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt
                                           ^
..\..\include/wx/debug.h:224:9: note: in expansion of macro 'wxFORCE_SEMICOLON'
         wxFORCE_SEMICOLON /* just to force a semicolon */
         ^
..\..\include/wx/dynarray.h:353:7: note: in expansion of macro 'wxCHECK2_MSG'
       wxCHECK2_MSG( iIndex != wxNOT_FOUND, return,                    \
       ^
..\..\include/wx/dynarray.h:486:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_HELPER'
     _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
     ^
..\..\include/wx/dynarray.h:669:5: note: in expansion of macro '_WX_DEFINE_TYPEARRAY_PTR'
     _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl)
     ^
..\..\include/wx/dynarray.h:649:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_WITH_DECL_PTR'
     WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class wxARRAY_DEFAULT_EXPORT)
     ^
..\..\include/wx/dynarray.h:825:5: note: in expansion of macro 'WX_DEFINE_TYPEARRAY_PTR'
     WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid)
     ^
../../src/msw/display.cpp:177:1: note: in expansion of macro 'WX_DEFINE_ARRAY_PTR'
 WX_DEFINE_ARRAY_PTR(wxDisplayInfo *, wxDisplayInfoArray);
 ^
../../src/msw/display.cpp: In member function 'virtual bool wxDisplayImplWin32Base::IsPrimary() const':
../../src/msw/display.cpp:481:30: error: 'MONITORINFOF_PRIMARY' was not declared in this scope
     return (m_info.m_flags & MONITORINFOF_PRIMARY) != 0;
                              ^
../../src/msw/display.cpp: In member function 'virtual int wxDisplayFactoryWin32Base::GetFromPoint(const wxPoint&)':
../../src/msw/display.cpp:580:56: error: 'MONITOR_DEFAULTTONULL' was not declared in this scope
                                                        MONITOR_DEFAULTTONULL));
                                                        ^
../../src/msw/display.cpp: In member function 'virtual int wxDisplayFactoryWin32Base::GetFromWindow(wxWindow*)':
../../src/msw/display.cpp:586:57: error: 'MONITOR_DEFAULTTONULL' was not declared in this scope
                                                         MONITOR_DEFAULTTONULL));
                                                         ^
mingw32-make: *** [gcc_msw\corelib_display.o] Error 1
I gave up.


2. My second try was with an older version of TDM-GCC (4.5.2).

Code: Select all

mingw32-make -f Makefile.gcc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=0
Build succeeded (with only a few warnings). Samples did start on Windows 95, even without the _WIN32_WINNT defines. This means success.


3. My third one was (just out of curiosity) MSVC++ 6.0.

Code: Select all

nmake /f makefile.vc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=0 RUNTIME_LIBS=static
At first sight it gave the best results. No compiler warnings at all. Really fast compilation. Three times smaller binaries than with GCC. All samples did work on Windows 95 and on Windows 7 as well.

What if I used MSVC++ 6.0 for compilation? What disadvantages will I have if I use MSVC 6.0 for compilation? Are there any known issues (that will never be fixed, because MSVC 6 is not supported anymore)?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

Thanks for the report, this is quite interesting.
What if I used MSVC++ 6.0 for compilation? What disadvantages will I have if I use MSVC 6.0 for compilation? Are there any known issues (that will never be fixed, because MSVC 6 is not supported anymore)?
wx 2.8.12 is frozen anyway. If this combination works, i'd use it.
Use the source, Luke!
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 »

You're welcome. Thanks for the tip.

2.8.12 has been a stable branch since the version 2.8.0 (released in 2006). The last maintenance release came out in 2011. So it was maintained for at least 5 years. As far as I see on GitHub, a few patches/backports have also been applied against the 2.8 branch since then (latest patch is from 2015). So can I safely use the latest stance of 2.8 without worrying about bugs? What if I find one? Or if I can fix/backport it, will you accept my pull request against 2.8 (without releasing it, of course)?

Also, can I easily compile my project for 2.8 with 3.0.2 (for newer OSes like Windows 10 or Ubuntu Linux)?

I mean, what exactly should I do with wxABI_VERSION and WXWIN_COMPATIBILITY_2_8 if I want my 2.8 code work on systems with 3.0.2 shared libs? E.g. if I want to make an Ubuntu package without static wxWidgets. What about Windows 10 where static building is more favorable? What should I do to make my 2.8 code compile with 3.0.2?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

So can I safely use the latest stance of 2.8 without worrying about bugs?
There are certainly unfixed bugs somewhere, whether they are critical or are relevant for your application may depend on which classes you use. I wouldn't worry too much about it though. I personally have a professional application still on sale which was started in 2004 and used wx 2.6.3 until recently, because it still worked fine.
What if I find one? Or if I can fix/backport it, will you accept my pull request against 2.8 (without releasing it, of course)?
You can of course fix it in your own codebase, the chance that it will be backported to 2.8 is slim though. However, this is a user-forum, there are no core wx developers here.
Also, can I easily compile my project for 2.8 with 3.0.2 (for newer OSes like Windows 10 or Ubuntu Linux)?
That depends on what classes you use and sometimes how you use them. 2.8 and 3.0 are not completely source-compatible, some differences will result in compilation errors, but in most cases you should be able to work around it with conditional compilation.

Read the section "INCOMPATIBLE CHANGES SINCE 2.8.x" in <wxdir>/docs/changes_30.txt
Use the source, Luke!
Post Reply