Started learning WxWidgets. You need to create XYZArray via WX_DECLARE_OBJARRAY and WX_DEFINE_OBJARRAY. But something doesn’t work, although I did everything as in the documentation.
# ifndef WXPOINTS_H_INCLUDED
#define WXPOINTS_H_INCLUDED
// # include "xyz.h"
#include & lt; wx / dynarray.h & gt;
class XYZ;
WX_DECLARE_OBJARRAY (XYZ, XYZArray);
class XYZ
{
public:
float x;
float y;
float z;
// void print ();
};
#include & lt; wx / arrimpl.cpp & gt;
WX_DEFINE_OBJARRAY (XYZArray);
class wxPoints
{
public:
wxPoints ();
XYZArray arr;
void Test ();
};
#endif // WXPOINTS_H_INCLUDED
Answer 1, authority 100%
The source in which the XYZArray is defined is included two times. CPP files should not be included via include, and H files should have a check for re-inclusion.