DrumFixer icon indicating copy to clipboard operation
DrumFixer copied to clipboard

FilterListHeader convert error

Open dacrhu opened this issue 4 years ago • 1 comments

Hi,

on Linux I get this error:

Compiling FilterList.cpp ../../Source/GUI/FilterList.cpp: In constructor ‘FilterList::FilterList(DrumFixerAudioProcessor&)’: ../../Source/GUI/FilterList.cpp:80:25: error: cannot convert ‘FilterListHeader*’ to ‘std::unique_ptrjuce::Component’ 80 | setHeaderComponent (new FilterListHeader); | ^~~~~~~~~~~~~~~~~~~~ | | | FilterListHeader* In file included from /usr/src/JUCE/modules/juce_gui_basics/juce_gui_basics.h:241, from /usr/src/JUCE/modules/juce_audio_plugin_client/juce_audio_plugin_client.h:53, from ../../Source/GUI/../../JuceLibraryCode/JuceHeader.h:20, from ../../Source/GUI/../PluginProcessor.h:3, from ../../Source/GUI/FilterList.h:4, from ../../Source/GUI/FilterList.cpp:1: /usr/src/JUCE/modules/juce_gui_basics/widgets/juce_ListBox.h:494:57: note: initializing argument 1 of ‘void juce::ListBox::setHeaderComponent(std::unique_ptrjuce::Component)’ 494 | void setHeaderComponent (std::unique_ptr<Component> newHeaderComponent); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ make: *** [Makefile:189: build/intermediate/Debug/FilterList_7b86

Can you help me? Thank you, David

dacrhu avatar Feb 13 '21 23:02 dacrhu

Hi! Thanks for reporting this issue.

The code for this plugin was originally written with JUCE version 5.4.4. It looks like in JUCE 6 they changed the ListBox::setHeaderComponent() function to take an std::unique_ptr instead of a raw pointer, which is what's causing the issue. There's basically two options to fix it:

  1. Revert to JUCE version 5.4.4. If you dowloaded JUCE by cloning their Git repo, this should be pretty easy.
  2. Fix the incompatible code. In this case, it should be this line. The correct line should be:
setHeaderComponent (std::make_unique<FilterListHeader>());

If this is the only error being caused by the new JUCE version, it's probably easiest to just make this fix. If you're getting a lot more error messages, then reverting to the earlier version of JUCE will probably be easier. If I have some time in the next week, maybe I can take a look at upgrading the project to JUCE 6. In the meantime, please let me know how these solutions work for you!

Thanks, Jatin

jatinchowdhury18 avatar Feb 14 '21 03:02 jatinchowdhury18