Lots of errors in Juce library code when building with JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1

Hello,

I’ve been experimenting with implementing my own version of the StandaloneFilterApp class. In my project’s CMakeLists.txt, I set JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 and added my new sources to the shared target, and in my header file I have this:

#include <juce_audio_plugin_client/juce_audio_plugin_client.h>
#include <juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h>

extern juce::JUCEApplicationBase* juce_CreateApplication();

class StandaloneFilterApp : public juce::JUCEApplication
{
public:
    StandaloneFilterApp();

    const juce::String getApplicationName() override { return JucePlugin_Name; }
    const juce::String getApplicationVersion() override { return JucePlugin_VersionString; }
    bool moreThanOneInstanceAllowed() override { return true; }
    void anotherInstanceStarted(const juce::String&) override {}

    virtual juce::StandaloneFilterWindow* createWindow();

    void initialise(const juce::String&) override;
    void shutdown() override;
    void systemRequestedQuit() override;

private:
    juce::ApplicationProperties appProperties;
    std::unique_ptr<juce::StandaloneFilterWindow> mainWindow;
    void requestQuit() const;
};

when I run the build, it fails and gives me a lot of errors in the Juce library code, what appear to be undefined types:

In file included from /home/runner/work/imogen/imogen/imogen/Source/StandaloneWrapper/StandaloneWrapper.h:6,
                 from /home/runner/work/imogen/imogen/imogen/Source/StandaloneWrapper/StandaloneWrapper.cpp:1:
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:558:21: error: ‘deviceManager’ was not declared in this scope
  558 |                     deviceManager.setMidiInputDeviceEnabled (oldDevice.identifier, false);
      |                     ^~~~~~~~~~~~~
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:561:39: error: request for member ‘contains’ in ‘((juce::StandalonePluginHolder*)this)->juce::StandalonePluginHolder::lastMidiDevices’, which is of non-class type ‘int’
  561 |                 if (! lastMidiDevices.contains (newDevice))
      |                                       ^~~~~~~~
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:562:21: error: ‘deviceManager’ was not declared in this scope
  562 |                     deviceManager.setMidiInputDeviceEnabled (newDevice.identifier, true);
      |                     ^~~~~~~~~~~~~
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h: At global scope:
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:599:35: error: ‘AudioDeviceManager’ does not name a type
  599 |                             const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr,
      |                                   ^~~~~~~~~~~~~~~~~~
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:599:71: error: expected unqualified-id before ‘*’ token
  599 |                             const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr,
      |                                                                       ^
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:599:71: error: expected ‘)’ before ‘*’ token
  599 |                             const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr,
      |                                                                       ^
      |                                                                       )
/home/runner/work/imogen/imogen/imogen/Builds/_deps/juce-src/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:594:28: note: to match this ‘(’
  594 |     StandaloneFilterWindow (const String& title,
      |                            ^

Did I do something wrong in setting this up, or is this an error in juce_StandaloneFilterWindow.h?

The standalone header requires that juce_audio_utils has been previously included. Adding the extra include after the juce_audio_plugin_client include should fix the issue.

Thank you for the info! I’m not at my computer now, but I will try this later today.

Might I suggest updating the audio_plugin_client module’s documentation? Last night I thought the problem might be a missing juce header, so I looked at the audio_plugin_client module declaration block in its header, and it lists a single dependancy of juce_audio_processors. But when I included that module header in my custom standalone filter header, I got these same errors.

The build is successful with that #include addition. Thank you!!