JanWilczek / audio-plugin-template

A template repository that you can use for creating audio plugins with the JUCE C++ framework. It is based on CMake, uses CPM package manager, the JUCE C++ framework (obviously), and the GoogleTest framework. All of these are easy to change on demand. You can also base off your new repo off this template because the setup is very simple.
The Unlicense
107 stars 7 forks source link

Sizeof errors ? #6

Closed MathiasSchneider-fr closed 5 months ago

MathiasSchneider-fr commented 9 months ago

I (on Macos) tried today your (very promising) solution and i have 2 weird errors :

[ 2%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o [ 5%] Linking CXX static library ../../../lib/libgtest.a [ 5%] Built target gtest [ 7%] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o [ 10%] Linking CXX static library ../../../lib/libgmock.a [ 10%] Built target gmock [ 12%] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o [ 15%] Linking CXX static library ../../../lib/libgmock_main.a [ 15%] Built target gmock_main [ 17%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o [ 20%] Linking CXX static library ../../../lib/libgtest_main.a [ 20%] Built target gtest_main [ 22%] Building CXX object plugin/CMakeFiles/AudioPlugin.dir/source/PluginEditor.cpp.o In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/source/PluginEditor.cpp:1: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/include/YourPluginName/PluginEditor.h:3: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/include/YourPluginName/PluginProcessor.h:3: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_audio_processors/juce_audio_processors.h:57: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/juce_gui_basics.h:60: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_graphics/juce_graphics.h:58: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_core/juce_core.h:204: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_core/system/juce_StandardHeader.h:50: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/algorithm:1747: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__algorithm/inplace_merge.h:28: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'juce::AccessibilityHandler' static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); ^~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<juce::AccessibilityHandler>::operator()' requested here __ptr_.second()(__tmp); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<juce::AccessibilityHandler>::reset' requested here _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } ^ /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/layout/juce_Viewport.h:346:20: note: in instantiation of member function 'std::unique_ptr<juce::AccessibilityHandler>::~unique_ptr' requested here return createIgnoredAccessibilityHandler (*this); ^ /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/juce_gui_basics.h:162:11: note: forward declaration of 'juce::AccessibilityHandler' class AccessibilityHandler; ^ In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/source/PluginEditor.cpp:1: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/include/YourPluginName/PluginEditor.h:3: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/plugin/include/YourPluginName/PluginProcessor.h:3: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_audio_processors/juce_audio_processors.h:57: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/juce_gui_basics.h:60: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_graphics/juce_graphics.h:58: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_core/juce_core.h:204: In file included from /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_core/system/juce_StandardHeader.h:50: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/algorithm:1747: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__algorithm/inplace_merge.h:28: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'juce::Drawable' static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); ^~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<juce::Drawable>::operator()' requested here __ptr_.second()(__tmp); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<juce::Drawable>::reset' requested here _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } ^ /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/menus/juce_PopupMenu.h:302:62: note: in instantiation of member function 'std::unique_ptr<juce::Drawable>::~unique_ptr' requested here std::unique_ptr<Drawable> iconToUse = {}); ^ /Users/matthieuvirmoux/plugtest/audio-plugin-template/libs/juce/modules/juce_gui_basics/juce_gui_basics.h:154:11: note: forward declaration of 'juce::Drawable' class Drawable; ^ 2 errors generated. gmake[2]: *** [plugin/CMakeFiles/AudioPlugin.dir/build.make:76: plugin/CMakeFiles/AudioPlugin.dir/source/PluginEditor.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:344: plugin/CMakeFiles/AudioPlugin.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2

I searched for a couple of hours but nothing... Does someone have an idea ?

Thanks

JanWilczek commented 9 months ago

This will be soon fixed in an upcoming update of JUCE but for now, I needed to downgrade the C++ standard on Macs. The fix was added in 256494c. Let me know if it works for you.

MathiasSchneider-fr commented 9 months ago

Thank you for your answer, i will try as soon as possible.