jpcima / ensemble-chorus

Digital model of electronic string ensemble chorus
Boost Software License 1.0
33 stars 2 forks source link

Compilation error: "cannot bind packed field" (juce::PixelARGB) #10

Closed SpotlightKid closed 5 years ago

SpotlightKid commented 5 years ago

I get the error below when trying to compile on Manjaro Linux (gcc 9.1.0). I remember seeing similar errors, when trying to compile other software using JUCE, that hasn't been updated in a while. The only reference I found for the error message is this old post from the JUCE forums, which mentions a fix but doesn't say what it is and might be only related to OS X PPC:

https://forum.juce.com/t/cannot-bind-packed-field-errors-in-xcode-3/9004

Here is the PKGBUILD script I'm using for compilation: https://gist.github.com/SpotlightKid/201bfa419faa2cb8a80195a8c55b0cbf

[ 44%] Building CXX object CMakeFiles/ensemble_chorus_fl.dir/sources/fl/main.cc.o
In file included from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.h:121,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.cpp:42,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp:9:
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h: In member function 'juce::uint8& juce::PixelARGB::getAlpha()':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:116:77: error: cannot bind packed field '((juce::PixelARGB*)this)->juce::PixelARGB::<anonymous>.juce::PixelARGB::<unnamed union>::comps[3]' to 'juce::uint8&' {aka 'unsigned char&'}
  116 |     forcedinline uint8& getAlpha() noexcept           { return comps [indexA]; }
      |                                                                ~~~~~~~~~~~~~^
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h: In member function 'juce::uint8& juce::PixelARGB::getRed()':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:117:77: error: cannot bind packed field '((juce::PixelARGB*)this)->juce::PixelARGB::<anonymous>.juce::PixelARGB::<unnamed union>::comps[2]' to 'juce::uint8&' {aka 'unsigned char&'}
  117 |     forcedinline uint8& getRed() noexcept             { return comps [indexR]; }
      |                                                                ~~~~~~~~~~~~~^
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h: In member function 'juce::uint8& juce::PixelARGB::getGreen()':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:118:77: error: cannot bind packed field '((juce::PixelARGB*)this)->juce::PixelARGB::<anonymous>.juce::PixelARGB::<unnamed union>::comps[1]' to 'juce::uint8&' {aka 'unsigned char&'}
  118 |     forcedinline uint8& getGreen() noexcept           { return comps [indexG]; }
      |                                                                ~~~~~~~~~~~~~^
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h: In member function 'juce::uint8& juce::PixelARGB::getBlue()':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:119:77: error: cannot bind packed field '((juce::PixelARGB*)this)->juce::PixelARGB::<anonymous>.juce::PixelARGB::<unnamed union>::comps[0]' to 'juce::uint8&' {aka 'unsigned char&'}
  119 |     forcedinline uint8& getBlue() noexcept            { return comps [indexB]; }
      |                                                                ~~~~~~~~~~~~~^
In file included from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.h:143,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.cpp:42,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp:9:
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h: In instantiation of 'void juce::RenderingHelpers::EdgeTableFillers::SolidColour<PixelType, replaceExisting>::replaceLine(juce::PixelRGB*, juce::PixelARGB, int) const [with PixelType = juce::PixelRGB; bool replaceExisting = true]':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:627:17:   required from 'void juce::RenderingHelpers::EdgeTableFillers::SolidColour<PixelType, replaceExisting>::handleEdgeTableLine(int, int, int) const [with PixelType = juce::PixelRGB; bool replaceExisting = true]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:2025:57:   required from 'void juce::RenderingHelpers::ClipRegions<SavedStateType>::RectangleListRegion::SubRectangleIteratorFloat::iterate(Renderer&) const [with Renderer = juce::RenderingHelpers::EdgeTableFillers::SolidColour<juce::PixelRGB, true>; SavedStateType = juce::RenderingHelpers::SoftwareRendererSavedState]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1591:13:   required from 'void juce::RenderingHelpers::EdgeTableFillers::renderSolidFill(Iterator&, const juce::Image::BitmapData&, juce::PixelARGB, bool, DestPixelType*) [with Iterator = juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIteratorFloat; DestPixelType = juce::PixelRGB]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:2644:67:   required from 'void juce::RenderingHelpers::SoftwareRendererSavedState::fillWithSolidColour(IteratorType&, juce::PixelARGB, bool) const [with IteratorType = juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIteratorFloat]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1896:13:   required from 'void juce::RenderingHelpers::ClipRegions<SavedStateType>::RectangleListRegion::fillRectWithColour(SavedStateType&, juce::Rectangle<float>, juce::PixelARGB) const [with SavedStateType = juce::RenderingHelpers::SoftwareRendererSavedState]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1893:14:   required from here
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:713:34: warning: converting a packed 'juce::PixelRGB' pointer (alignment 1) to a 'int' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  713 |                             auto d = reinterpret_cast<int*> (dest);
      |                                  ^
In file included from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.h:121,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.cpp:42,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp:9:
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:366:17: note: defined here
  366 | class JUCE_API  PixelRGB
      |                 ^~~~~~~~
In file included from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.h:143,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.cpp:42,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp:9:
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h: In instantiation of 'void juce::RenderingHelpers::EdgeTableFillers::SolidColour<PixelType, replaceExisting>::replaceLine(juce::PixelRGB*, juce::PixelARGB, int) const [with PixelType = juce::PixelRGB; bool replaceExisting = false]':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:627:17:   required from 'void juce::RenderingHelpers::EdgeTableFillers::SolidColour<PixelType, replaceExisting>::handleEdgeTableLine(int, int, int) const [with PixelType = juce::PixelRGB; bool replaceExisting = false]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:2025:57:   required from 'void juce::RenderingHelpers::ClipRegions<SavedStateType>::RectangleListRegion::SubRectangleIteratorFloat::iterate(Renderer&) const [with Renderer = juce::RenderingHelpers::EdgeTableFillers::SolidColour<juce::PixelRGB, false>; SavedStateType = juce::RenderingHelpers::SoftwareRendererSavedState]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1596:13:   required from 'void juce::RenderingHelpers::EdgeTableFillers::renderSolidFill(Iterator&, const juce::Image::BitmapData&, juce::PixelARGB, bool, DestPixelType*) [with Iterator = juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIteratorFloat; DestPixelType = juce::PixelRGB]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:2644:67:   required from 'void juce::RenderingHelpers::SoftwareRendererSavedState::fillWithSolidColour(IteratorType&, juce::PixelARGB, bool) const [with IteratorType = juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIteratorFloat]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1896:13:   required from 'void juce::RenderingHelpers::ClipRegions<SavedStateType>::RectangleListRegion::fillRectWithColour(SavedStateType&, juce::Rectangle<float>, juce::PixelARGB) const [with SavedStateType = juce::RenderingHelpers::SoftwareRendererSavedState]'
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:1893:14:   required from here
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h:713:34: warning: converting a packed 'juce::PixelRGB' pointer (alignment 1) to a 'int' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  713 |                             auto d = reinterpret_cast<int*> (dest);
      |                                  ^
In file included from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.h:121,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/juce_graphics.cpp:42,
                 from /home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp:9:
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h:366:17: note: defined here
  366 | class JUCE_API  PixelRGB
      |                 ^~~~~~~~
make[2]: *** [CMakeFiles/juce_graphics.dir/build.make:63: CMakeFiles/juce_graphics.dir/sources/plugin/JuceLibraryCode/include_juce_graphics.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:820: CMakeFiles/juce_graphics.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/fl/main.cc: In function 'void handle_signals()':
/home/chris/work/arch/aur/ensemble-chorus-git/src/ensemble-chorus/sources/fl/main.cc:240:10: warning: variable 'success' set but not used [-Wunused-but-set-variable]
  240 |     bool success = false;
      |          ^~~~~~~
[ 46%] Linking CXX executable ensemble_chorus_fl
[ 46%] Built target ensemble_chorus_fl
[ 47%] Linking CXX static library libjuce_core.a
[ 47%] Built target juce_core
make: *** [Makefile:130: all] Error 2
jpcima commented 5 years ago

I use the following as a fix in the package adlplug-git. "juce-gcc9.patch::https://github.com/WeAreROLI/JUCE/commit/4e0adb2af8b424c43d22bd431011c9a6c57d36b6.patch"

About this software, it's currently as indicated on the label, it's experimental. The most short term plan, when I get around to it, is to rewrite it in DPF.

Next, I have to apply to it some of my research which 1. change entirely how the modulation is processed 2. implement a better analog fidelity version of the delay line, which is already in string machine. The new model will allow clock rates greater than nyquist rate, and to reach a lower range of delays for chorus.

So all that being considered, this plugin is going to go through major changes, so don't expect any stability.

SpotlightKid commented 5 years ago

Thanks, that patch did the trick.

https://aur.archlinux.org/packages/ensemble-chorus-git/

The plugin seems to work well so far as it is. I like having the possibility of sending my hardware synths through this effect.