Error starting audio plugin from Visual Studio 2015 after building succesfully

I am trying to run the audio plugin created during the tutorial:
https://www.juce.com/doc/tutorial_code_basic_plugin.

It builds successfully but doesn’t start and gives error:

Unable to start program …\TutotrialPlugin\Builds\VisualStudio2015\Debug\TutrorialPlugin.dll

Operation not supported. Unknown error: 0x800700c1.

Yeah, it’s weird. The reason why that’s happening is because the debugger is attempting to execute your plugin like a standalone application, which won’t work since it’s just a DLL. There are two ways of setting up plugin debugging in VS that I know of:

First way: You need to start up a host (Ableton, Reaper, whatever) and attach the VS debugger to it, then load an instance of your plugin. VS should be able to load the debug symbols for your plugin automatically and then you’ll be able to set breakpoints in your plugin code as it’s executing.

So instead of clicking “Local Windows Debugger”, start up your host, then in VS go to Debug -> Attach to Process and pick your host application. Now set a breakpoint somewhere in your plugin source in the VS code editor. When you load your plugin in the host, so long as you set the breakpoint somewhere it will be hit (i.e. processor’s constructor or prepareToPlay or processBlock, etc) the program should pause and you know you’re debugging!

Second way: This is my preferred way, it’s basically an automatic way of doing the method above that allows you to use the “Local Windows Debugger” button. Right click on your plugin project in VS (the first item under the solution in the browser) and open properties. Go to “Debugging”, and set “Command” to be a path to your host’s .exe. In some cases (like the JUCE demo plugin host I’m pretty sure) you can also set a file for the host to open automatically on launch by specifying it in the “Command Arguments” field. That way if you want you can auto-open some host project that has your plugin and some test audio in it or something which helps a lot with rapid iteration.

You should now be able to press “Local Windows Debugger” and it will automatically open your host and attach the debugger to it, allowing you to load your plugin and debug it.

Hopefully this helps!

2 Likes

Thank you very much for your answer! I’ve tried the second way, however whenever I set the command to my host’s .exe, as soon as I leave properties it changes back to the previous path to .dll

Assuming something totally weird hasn’t happened like the .vcxproj became read-only or something, you’re hitting “Apply” then “Ok” right? As opposed to just closing the window after changing the value?

Hey guys,

Just started with JUCE today, and tried to compile the audioplugin starting project with Visual Studio 2015. I encountered the same problem, as it will give me the .dll error. I went and changed the “Command” property, and set it to the path of my build of JUCE demo plugin host. So, when i press “Local WD” it starts the plugin host, but nothing about my host …

Any help ?

Also this …
Runned the VST successfuly, but keeps breaking me in asserts, altough it runs …

In the plugin host you need to go to options -> Edit the list of available plugins ( or Ctrl + p), then in pop-up window press options.
Once the select folders to scan window appears press the ‘+’ button and browse to your plugin project. Then press scan. It will bring up the ‘break point trigger’ just keep pressing continue - there is probably a way to disable not sure how though sorry.

Once the scan is finished you should see your plugin in the available plugins windows - close this. Then back to main window ‘Plugin Host’ and go to Plugins -> Create Plugins -> ‘name of company your plugin has’ -> ‘your plugin name’.

This should add, this is all in the create a basic plugin tutorial on Juce as well. If you were looking for a way to automatically have it there once you executed I’m not really sure how to do that.

For some reason my window looks exactly like my screen shots so there are no OK or apply buttons. I managed to save it by clicking enter button on my keyboard but for some reason the window cuts off hiding the buttons. But thank you it did work in the end!

Yeah, it does all those asserts for some reason but it should run fine anyway if you continue past them.

I can’t seem to reproduce the assert you are showing in that screenshot. Are you testing the JuceDemoPlugin? Was both the host and the JuceDemoPlugin built with the newest version of JUCE?

Thanks for all the replies.

Yes fabian i built everything with a fresh version of JUCE and VS2015, just downloaded both yesterday. I build this under VS2015:

Like they suggest in the tutorials. It’s kind of a pain in the ass to be stopped 3 times in those asserts … Any hints on how to solve that ?

The asserts in the screeenshots are in the plug-in code not the “audio plugin host”. Which plug-in are you trying to run?

My own audo-plugin project !

Hmmm… can you pm me or post a stripped down version of your code containing the constructor, the setPreferredBusArrangment method and the Projucer’s “Audio Plug-In Layout Configuration” field?