Author Topic: New wxWidgets releases  (Read 512 times)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
New wxWidgets releases
« on: Yesterday at 06:55:10 pm »
wx3.2.10 and wx3.3.2 have been released simultaneously.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7819
    • My Best Post
Re: New wxWidgets releases
« Reply #1 on: Today at 01:11:32 am »
Has anyone gotten Code::Blocks to build with wx3.3.2?
I gave up building wxWidgets git master about a month ago because of a build error already reported on this website by someone else.
Had to do with scripting and the red, blue, and green methods.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #2 on: Today at 04:32:18 am »
Code
[ 23.3%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschoice.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxschoice.o
In file included from F:\code\wxWidgets-3.3.2\include/wx/arrstr.h:15,
                 from F:\code\wxWidgets-3.3.2\include/wx/ctrlsub.h:17,
                 from F:\code\wxWidgets-3.3.2\include/wx/listbox.h:21,
                 from F:\code\wxWidgets-3.3.2\include/wx/checklst.h:17,
                 from F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschecklistbox.cpp:24:
F:\code\wxWidgets-3.3.2\include/wx/dynarray.h: In instantiation of 'T& wxBaseArray<T, Sorter>::operator[](size_t) [with T = bool; Sorter = wxSortedArray_SortFunction<bool>; size_t = long long unsigned int]':
F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschecklistbox.cpp:72:35:   required from here
   72 |                 if ( ArrayChecks[i] )
      |                                   ^
F:\code\wxWidgets-3.3.2\include/wx/dynarray.h:128:36: error: cannot bind non-const lvalue reference of type 'bool&' to an rvalue of type 'bool'
  128 |         return base_vec::operator[](uiIndex);
      |                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from D:/code/msys2/mingw64/include/c++/14.2.0/vector:67,
                 from F:\code\wxWidgets-3.3.2\include/wx/strvararg.h:34,
                 from F:\code\wxWidgets-3.3.2\include/wx/string.h:34,
                 from F:\code\wxWidgets-3.3.2\include/wx/arrstr.h:14:
D:/code/msys2/mingw64/include/c++/14.2.0/bits/stl_bvector.h:99:5: note:   after user-defined conversion: 'std::_Bit_reference::operator bool() const'
   99 |     operator bool() const _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
Process terminated with status 1 (15 minute(s), 30 second(s))
 
Process terminated with status 0 (15 minute(s), 32 second(s))
1 error(s), 28 warning(s) (15 minute(s), 32 second(s))
 


I just tried, and I see the build failure as above.

I built the wx 3.3.2 library with the command:

Code
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #3 on: Today at 06:31:35 am »
I just compare the 2 release:

https://github.com/wxWidgets/wxWidgets/compare/v3.3.1...v3.3.2

I see this that the only 2 functions were added in the file: include/wx/dynarray.h


Code
T& operator[](size_t uiIndex)
    {
        wxASSERT( uiIndex < this->size() );
        return base_vec::operator[](uiIndex);
    }

    const T& operator[](size_t uiIndex) const
    {
        wxASSERT( uiIndex < this->size() );
        return base_vec::operator[](uiIndex);
    }


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
Re: New wxWidgets releases
« Reply #4 on: Today at 09:29:36 am »
Has anyone gotten Code::Blocks to build with wx3.3.2?
I gave up building wxWidgets git master about a month ago because of a build error already reported on this website by someone else.
Had to do with scripting and the red, blue, and green methods.

This was fixed in r13802.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
Re: New wxWidgets releases
« Reply #5 on: Today at 09:53:21 am »
Ollydbg, you can try changing (in wxsarraystringcheckproperty.cpp) line 28 to this
Code
WX_DEFINE_ARRAY(bool, wxArrayBool);

wxSmith plays with offsets and code magic to access the array, this may be a headache.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #6 on: Today at 10:00:32 am »
Ollydbg, you can try changing (in wxsarraystringcheckproperty.cpp) line 28 to this
Code
WX_DEFINE_ARRAY(bool, wxArrayBool);

wxSmith plays with offsets and code magic to access the array, this may be a headache.

Well, in the wxsarraystringcheckproperty.cpp file, it has:

Code
#include "wxsarraystringcheckproperty.h"
#include "wxsarraystringcheckeditordlg.h"

#include <globals.h>

// Helper macros for fetching variables
#define VALUE   wxsVARIABLE(Object,Offset,wxArrayString)
#define CHECK   wxsVARIABLE(Object,CheckOffset,wxArrayBool)


Which part of the code do I need to change?

EDIT:
Oh, you mean in the header file.
Let me try it.

« Last Edit: Today at 10:03:14 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #7 on: Today at 10:11:25 am »
I just changed to this:

Code
#ifndef WXSARRAYSTRINGCHECKPROPERTY_H
#define WXSARRAYSTRINGCHECKPROPERTY_H

#include "../../properties/wxsproperties.h"

WX_DEFINE_ARRAY(bool,wxArrayBool);

But I see still the same build error.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
Re: New wxWidgets releases
« Reply #8 on: Today at 11:46:26 am »
I am sorry for the confussion with the extension.

Can you change (in wxschecklistbox.cpp:72) this
Code
                if ( ArrayChecks[i] )
                {
                    Codef( _T("%ACheck("));
                }
                Codef( _T("%AAppend(%t)"), ArrayChoices[i].wx_str());
                if ( ArrayChecks[i] )
                {
                    Codef(_T(")"));
                }
to this
Code
                const bool Checked = ArrayChecks[i];
                if ( Checked )
                {
                    Codef( _T("%ACheck("));
                }
                Codef( _T("%AAppend(%t)"), ArrayChoices[i].wx_str());
                if ( Checked )
                {
                    Codef(_T(")"));
                }

In line 102 there is another if (), it is expected to fail but the error in line 72 should be gone.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #9 on: Today at 01:04:45 pm »
Still the same error:

Code
-------------- Build: wxSmithLib in wxSmith Windows (compiler: GNU GCC Compiler)---------------

[  0.6%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxssettings.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxssettings.o
[  1.3%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsanimationctrl.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxsanimationctrl.o
[  1.9%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsbitmapbutton.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxsbitmapbutton.o
[  2.5%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsbitmapcombobox.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxsbitmapcombobox.o
[  3.2%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsboxsizer.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxsboxsizer.o
[  3.8%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsbutton.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxsbutton.o
[  4.4%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxscalendarctrl.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxscalendarctrl.o
[  5.1%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxscheckbox.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxscheckbox.o
[  5.7%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschecklistbox.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxschecklistbox.o
[  6.3%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -D_WIN64 -DWXUSINGDLL -DcbDEBUG -DNOPCH -DBUILDING_PLUGIN -DwxUSE_UNICODE -std=gnu++11 -g -std=gnu++11 -IF:\code\wxWidgets-3.3.2\lib\gcc_dll\mswud -IF:\code\wxWidgets-3.3.2\include -I..\..\..\include -I..\..\..\include\tinyxml -I..\..\..\sdk\wxscintilla\include -I..\..\..\include\scripting\include -c F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschoice.cpp -o ..\..\..\.objs33_64\plugins\contrib\wxSmithLib\wxwidgets\defitems\wxschoice.o
In file included from F:\code\wxWidgets-3.3.2\include/wx/arrstr.h:15,
                 from F:\code\wxWidgets-3.3.2\include/wx/ctrlsub.h:17,
                 from F:\code\wxWidgets-3.3.2\include/wx/listbox.h:21,
                 from F:\code\wxWidgets-3.3.2\include/wx/checklst.h:17,
                 from F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschecklistbox.cpp:24:
F:\code\wxWidgets-3.3.2\include/wx/dynarray.h: In instantiation of 'T& wxBaseArray<T, Sorter>::operator[](size_t) [with T = bool; Sorter = wxSortedArray_SortFunction<bool>; size_t = long long unsigned int]':
F:\code\codeblocks-src\codeblocks_sfmirror\src\plugins\contrib\wxSmith\wxwidgets\defitems\wxschecklistbox.cpp:72:51:   required from here
   72 |                 const bool Checked = ArrayChecks[i];
      |                                                   ^
F:\code\wxWidgets-3.3.2\include/wx/dynarray.h:128:36: error: cannot bind non-const lvalue reference of type 'bool&' to an rvalue of type 'bool'
  128 |         return base_vec::operator[](uiIndex);
      |                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from D:/code/msys2/mingw64/include/c++/14.2.0/vector:67,
                 from F:\code\wxWidgets-3.3.2\include/wx/strvararg.h:34,
                 from F:\code\wxWidgets-3.3.2\include/wx/string.h:34,
                 from F:\code\wxWidgets-3.3.2\include/wx/arrstr.h:14:
D:/code/msys2/mingw64/include/c++/14.2.0/bits/stl_bvector.h:99:5: note:   after user-defined conversion: 'std::_Bit_reference::operator bool() const'
   99 |     operator bool() const _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
Process terminated with status 1 (0 minute(s), 38 second(s))
 
Process terminated with status 0 (0 minute(s), 40 second(s))
1 error(s), 2 warning(s) (0 minute(s), 40 second(s))

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
Re: New wxWidgets releases
« Reply #10 on: Today at 02:11:45 pm »
Thanks for testing. The problem is explained here

Quote
WX_DEFINE_ARRAY_INT(bool) cannot be used because of the differences in std::vector<bool> specialization compared with the generic std::vector<> class. Please either use std::vector<bool> directly or use wxArrayInt instead.

So the solution may be using WX_DEFINE_ARRAY_INT(int, wxArrayBool) or using wxArrayInt directly, possibly using a typedef.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #11 on: Today at 02:34:21 pm »
Thanks for testing. The problem is explained here

Quote
WX_DEFINE_ARRAY_INT(bool) cannot be used because of the differences in std::vector<bool> specialization compared with the generic std::vector<> class. Please either use std::vector<bool> directly or use wxArrayInt instead.

So the solution may be using WX_DEFINE_ARRAY_INT(int, wxArrayBool) or using wxArrayInt directly, possibly using a typedef.

Yes, this is the direction. I have conversation with chatgpt, and it also gives me similar advice.

Let me try this first:

WX_DEFINE_ARRAY_INT(unsigned char, wxArrayBool)


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6184
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New wxWidgets releases
« Reply #12 on: Today at 02:48:52 pm »
Let me try this first:

WX_DEFINE_ARRAY_INT(unsigned char, wxArrayBool)

Code
diff --git a/src/plugins/contrib/wxSmith/wxwidgets/properties/wxsarraystringcheckproperty.h b/src/plugins/contrib/wxSmith/wxwidgets/properties/wxsarraystringcheckproperty.h
index ab0b632..d9846f1 100644
--- a/src/plugins/contrib/wxSmith/wxwidgets/properties/wxsarraystringcheckproperty.h
+++ b/src/plugins/contrib/wxSmith/wxwidgets/properties/wxsarraystringcheckproperty.h
@@ -25,7 +25,7 @@
 
 #include "../../properties/wxsproperties.h"
 
-WX_DEFINE_ARRAY_INT(bool,wxArrayBool);
+WX_DEFINE_ARRAY_INT(unsigned char,wxArrayBool);
 
 /** \brief Property for editing arrays of strings with checked option
  *


This patch works OK now.


EDIT:

Now, I see the whole workspace is built OK now with wx 3.3.2. (note I do not build Fortran plugin nor the NassiShneiderman plugin)
« Last Edit: Today at 03:00:28 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1837
Re: New wxWidgets releases
« Reply #13 on: Today at 06:09:38 pm »
I have tested the patch with wx3.0.2 on Linux and wx3.2.10 on MSW, works OK. Do you plan to commit it?