jatinchowdhury18 / DrumFixer

Audio plugin for editing drum tones
GNU General Public License v3.0
26 stars 4 forks source link

FilterListHeader convert error #2

Open dacrhu opened 3 years ago

dacrhu commented 3 years ago

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_ptr’ 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_ptr)’ 494 | void setHeaderComponent (std::unique_ptr newHeaderComponent); | ~~~~~^~~~ make: *** [Makefile:189: build/intermediate/Debug/FilterList_7b86

Can you help me? Thank you, David

jatinchowdhury18 commented 3 years ago

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