# Opening plugins

**URL:** <https://forum.juce.com/t/opening-plugins/19794>\
**Category:** Audio Plugins\
**Created:** [November 6, 2016, 5:49pm UTC](https://forum.juce.com/t/opening-plugins/19794 "2016-11-06T17:49:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liamtmlacey](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/liamtmlacey/32/82_2.png) [@liamtmlacey](https://forum.juce.com/u/liamtmlacey)\
**Post date:** [November 6, 2016, 5:49pm UTC](https://forum.juce.com/t/opening-plugins/19794/1 "2016-11-06T17:49:10Z")

</div>

Hey,

After seeing some inspiring talks at ADC last week I’ve decided to revive a 2 year old project of mine that I never got round to finishing, however when attempting to run it with the latest version of JUCE I’m getting errors.

Essentially I’m attempting to load an audio plugin within a plugin, and now when I try to load a plugin file with createPluginInstance() I get the following error message: “No compatible plug-in format exists for this plug-in”, which sets my AudioPluginInstance instance object to be a nullptr.

Here is my code for doing this which did previously work with whatever the latest JUCE version was in June 2014:

```
AudioPluginFormatManager formatManager;
AudioPluginInstance *pluginInstance;
PluginDescription wrappedPluginInfo;

formatManager.addDefaultFormats();
String errorMessage;

if (AudioProcessor::wrapperType == wrapperType_AudioUnit)
{
    wrappedPluginInfo.fileOrIdentifier = "/Library/Audio/Plug-Ins/Components/Driver.component";
}
else if (AudioProcessor::wrapperType == wrapperType_VST)
{
    wrappedPluginInfo.fileOrIdentifier = "/Library/Audio/Plug-Ins/VST/Driver.vst";
}

pluginInstance = formatManager.createPluginInstance (wrappedPluginInfo, 48000, 512, errorMessage);

if (pluginInstance == nullptr)
{
    std::cout << errorMessage << std::endl;
}

```

What’s changed or what have I done wrong?

Many thanks.

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [November 7, 2016, 12:30pm UTC](https://forum.juce.com/t/opening-plugins/19794/2 "2016-11-07T12:30:14Z")

</div>

Try something like this:

```
String pluginPath;
if (AudioProcessor::wrapperType == wrapperType_AudioUnit)
    pluginPath = "/Library/Audio/Plug-Ins/Components/Driver.component";
else if (AudioProcessor::wrapperType == wrapperType_VST)
    pluginPath = "/Library/Audio/Plug-Ins/VST/Driver.vst";

OwnedArray<PluginDescription> pluginDescriptions;
KnownPluginList plist;
AudioPluginFormatManager pluginFormatManager;
pluginFormatManager.addDefaultFormats();
for (int i = 0; i < pluginFormatManager.getNumFormats(); ++i)
    plist.scanAndAddFile(pluginPath,
                         true,
                         pluginDescriptions,
                         *pluginFormatManager.getFormat(i));

jassert (pluginDescriptions.size() > 0);
String msg;
instance = pluginFormatManager.createPluginInstance(*pluginDescriptions[0],
                                                    48000,
                                                    512,
                                                    msg);

```

There may be a typo in there somewhere!

---

<div class="post-metadata">

**Author:** ![liamtmlacey](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/liamtmlacey/32/82_2.png) [@liamtmlacey](https://forum.juce.com/u/liamtmlacey)\
**Post date:** [November 8, 2016, 8:14am UTC](https://forum.juce.com/t/opening-plugins/19794/3 "2016-11-08T08:14:44Z")

</div>

Hey Tom,

Many thanks for this - it’s working perfectly now!
