An application which has been compiled with no errors since a number of years on MSW and OSX, now raises a problem with the code below.
Under Windows 10, with today's trunk and Visual Studio 2017 WX_DECLARE_OBJARRAY is undelined with green wigglies, reporting that the function declaration is not found but finally getting the application up and running.
Under OSX (10.13.5) GCC 8 raises an error in the second line, pointing at the beginning of the line and claiming a ')'. OSX then raises an error on the fourth line "out-of-line definition of 'Clone' does not match any declaration in wxOnjectArrayTraitsForArrayOfCFTextCtrlPointers'
#include <wx/dynarray.h>
WX_DECLARE_OBJARRAY(wxTextCtrl*, ArrayOfCFTextCtrlPointers);
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY(ArrayOfCFTextCtrlPointers);
What is the problem here? (suggestions to use wxVector aside).
dynarray Topic is solved
Re: dynarray
What exactly did change since the last time you compiled this? The compiler or the wxWidgets version, or both or anything else?
This is a little strange, because WX_DECLARE_OBJARRAY assumes pointers anyway. So most likely it should be:
But then it shouldn't have worked before.
Code: Select all
WX_DECLARE_OBJARRAY(wxTextCtrl*, ArrayOfCFTextCtrlPointers);
Code: Select all
WX_DECLARE_OBJARRAY(wxTextCtrl, ArrayOfCFTextCtrlPointers);
Use the source, Luke!
Re: dynarray
There have been several changes to the obsolete containers code, see
https://github.com/wxWidgets/wxWidgets/ ... pe=Commits
I guess these should not break anything in the existing code (assuming the code was correct)...
https://github.com/wxWidgets/wxWidgets/ ... pe=Commits
I guess these should not break anything in the existing code (assuming the code was correct)...
-
- Super wx Problem Solver
- Posts: 488
- Joined: Fri Oct 27, 2006 4:35 pm
- Location: Paris, France
- Contact:
Re: dynarray
@doublemax
Both changed, apparently - the compiler with 10.13.5 and the code with the trunk.
I'll try with 3.1.1, and then look into wxVector...
@PB
I dont know if the code was correct, but it worked...
Both changed, apparently - the compiler with 10.13.5 and the code with the trunk.
I'll try with 3.1.1, and then look into wxVector...
@PB
I dont know if the code was correct, but it worked...
-
- Super wx Problem Solver
- Posts: 488
- Joined: Fri Oct 27, 2006 4:35 pm
- Location: Paris, France
- Contact:
Re: dynarray
No problems with 3.1.1
The trunk is no longer back-compatible for dynarray with 3.1.1 since June 1.
The trunk is no longer back-compatible for dynarray with 3.1.1 since June 1.
Re: dynarray
As doublemax already said, you are not to use a pointer to the class in the declaration of wxObjArray. The documentation states that, e.g. here, but I guess it could be a bit clearer about that...raananb wrote:What is the problem here?Code: Select all
#include <wx/dynarray.h> WX_DECLARE_OBJARRAY(wxTextCtrl*, ArrayOfCFTextCtrlPointers);
-
- Super wx Problem Solver
- Posts: 488
- Joined: Fri Oct 27, 2006 4:35 pm
- Location: Paris, France
- Contact:
Re: dynarray
The compatibility break bug was reported and a patch was created to restore it (#18169).