sjaehn / BChoppr

An audio stream chopping LV2 plugin
GNU General Public License v3.0
33 stars 3 forks source link

`field ‘data_’ has incomplete type ‘std::array<BChopprNotifications, 64>’` #18

Closed KottV closed 1 year ago

KottV commented 1 year ago

Hi,

1.12.4 fails to compile due incomplete type of data_ in BChoppr_GUI.hpp:

In file included from ../../src/BChoppr_GUI.hpp:52:                                                                                                                                                                                                  [40/817]
../../src/Monitor.hpp: At global scope:
../../src/Monitor.hpp:57:56: error: field ‘data_’ has incomplete type ‘std::array<BChopprNotifications, 64>’
   57 |    std::array<BChopprNotifications, MONITORBUFFERSIZE> data_;
      |                                                        ^~~~~
In file included from /usr/include/c++/12/bits/stl_map.h:63,
                 from /usr/include/c++/12/map:61,
                 from ../../src/BWidgets/BStyles/Types/ColorMap.hpp:22,
                 from ../../src/BWidgets/BStyles/Style.hpp:25,
                 from ../../src/BChoppr_GUI.hpp:26:
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BChopprNotifications, 64>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:152:50: error: field ‘stepLevelControl’ has incomplete type ‘std::array<BWidgets::VSlider*, 16>’
  152 |         std::array<BWidgets::VSlider*, MAXSTEPS> stepLevelControl;
      |                                                  ^~~~~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::VSlider*, 16>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:153:47: error: field ‘stepPanControl’ has incomplete type ‘std::array<BWidgets::Dial*, 16>’
  153 |         std::array<BWidgets::Dial*, MAXSTEPS> stepPanControl;
      |                                               ^~~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::Dial*, 16>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:154:52: error: field ‘stepLevelControlLabel’ has incomplete type ‘std::array<BWidgets::EditLabel*, 16>’
  154 |         std::array<BWidgets::EditLabel*, MAXSTEPS> stepLevelControlLabel;
      |                                                    ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::EditLabel*, 16>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:155:52: error: field ‘stepPanControlLabel’ has incomplete type ‘std::array<BWidgets::EditLabel*, 16>’
  155 |         std::array<BWidgets::EditLabel*, MAXSTEPS> stepPanControlLabel;
      |                                                    ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::EditLabel*, 16>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:156:43: error: field ‘markerWidgets’ has incomplete type ‘std::array<Marker*, 15>’
  156 |         std::array<Marker*, MAXSTEPS - 1> markerWidgets;
      |                                           ^~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<Marker*, 15>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:163:42: error: field ‘sharedDataButtons’ has incomplete type ‘std::array<BWidgets::Button*, 4>’
  163 |         std::array<BWidgets::Button*, 4> sharedDataButtons;
      |                                          ^~~~~~~~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::Button*, 4>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
../../src/BChoppr_GUI.hpp:171:54: error: field ‘controllers’ has incomplete type ‘std::array<BWidgets::Widget*, 56>’
  171 |         std::array<BWidgets::Widget*, NrControllers> controllers;
      |                                                      ^~~~~~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<BWidgets::Widget*, 56>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;

Also there is a little warning about copying:

../../src/BWidgets/BWidgets/../BStyles/Theme.hpp: In constructor ‘BStyles::Theme::Theme(const std::initializer_list<std::pair<const unsigned int, BStyles::Style> >&)’:
../../src/BWidgets/BWidgets/../BStyles/Theme.hpp:87:49: warning: loop variable ‘l’ creates a copy from type ‘const std::pair<const unsigned int, BStyles::Style>’ [-Wrange-loop-construct]
   87 |     for (const std::pair<const uint32_t, Style> l : list) operator[](l.first) = l.second;
      |                                                 ^
../../src/BWidgets/BWidgets/../BStyles/Theme.hpp:87:49: note: use reference type to prevent copying
   87 |     for (const std::pair<const uint32_t, Style> l : list) operator[](l.first) = l.second;
      |                                                 ^
      |                                                 &
sjaehn commented 1 year ago

Indeed. The fails: missing #include <array>. And the warning: missing reference operator &. I'll fix it this evening.

sjaehn commented 1 year ago

Fixed in the master branch.

sjaehn commented 1 year ago

... and in the release 1.12.6