Changes Required to build standalone application

Hello all,

I am building an audio plugin using .jucer file, project settings are defaulted to vst3 build, but I want to change it to standalone .exe build.
I have tried following changes:

  1. Plugin Formats in Projucer > project settings – added standalone
  2. In visual studio 2022, debug properties > configuration type > selected application .exe
  3. In visual studio 2022, properties > Linker > General > Outfile – .exe

On changing all these parameters, encountered a linking error
error lnk2019: unresolved external symbol main referenced in function “int __cdecl invoke_main(void)” (?invoke_main@@yahxz)

Are there any other changes required?
Any help/suggestion is appreciated! TIA!

Only the step 1 is necessary - step 2 and 3 are likely to cause problems, so I’d recommend re-saving your project in the Projucer.

After that, in Visual Studio, you should see a sidebar with the names of the different targets in the solution. In particular, there should be separate VST3 and Standalone targets. To build and test the Standalone, right-click the Standalone target, and select “Set as startup project”. Now, the “Run” button will build the Standalone and launch it under the debugger.

Thanks for quick response @reuk !
I tried as you mentioned here, but on setting standalone as startup project, encountered this error,
#error: to compile audiounitv3 and/or standalone plug-ins, you need to add the juce_audio_utils and juce_audio_devices modules!

I know it’s pretty straight forward, but I am using juce as submodule directly from JUCE git repository.
How to deal with that?
Adding it in .jucer would help?

In the Projucer, open the “Modules” panel on the left hand side of the project window. At the bottom of the panel is a “+” button that will open a menu, allowing you to add extra modules.

Add the juce_audio_utils and juce_audio_devices modules, then resave the project, and reopen the VS project.

1 Like

ok yes Solved!
@reuk Thank you again!

1 Like

@reuk on changing the project settings to build standalone plugin,
I ran into the exception thrown when trying to build the project, which mentions
JUCE Assertion failure in juce_AudioProcessorValueTreeState.cpp:315

I did some searching, and found the related topic,

As discussed here, I added treeState.state = ValueTree("MyPlugin"); explicitly. (after adding parameters)

But still running into same exception,
and one thing to mention, I get this exception, only when building in standalone, vst3 builds successfully.

Any suggestion on how to tackle this issue?