Why can´t i build my Juce Audio Plugin into .exe, .vst3 files?

I am using Visual Studio 2019. I am trying to build my solution to create the .exe and .vst3 files to run it in debugger mode.
I keep getting these errors:

Error	LNK2019	unresolved external symbol "public: class juce::AudioProcessorValueTreeState::ParameterLayout __cdecl DelayPluginAudioProcessor::CreateParameterLayout(void)" (?CreateParameterLayout@DelayPluginAudioProcessor@@QEAA?AVParameterLayout@AudioProcessorValueTreeState@juce@@XZ) referenced in function "public: __cdecl DelayPluginAudioProcessor::DelayPluginAudioProcessor(void)" (??0DelayPluginAudioProcessor@@QEAA@XZ)	DelayPlugin_StandalonePlugin	C:\Users\dvi\OneDrive\Bureaublad\DelayPlugin\DelayPlugin\Builds\VisualStudio2019\DelayPlugin.lib(PluginProcessor.obj)	1	

Error	LNK1120	1 unresolved externals	DelayPlugin_StandalonePlugin	C:\Users\dvi\OneDrive\Bureaublad\DelayPlugin\DelayPlugin\Builds\VisualStudio2019\x64\Debug\Standalone Plugin\DelayPlugin.exe	1	

Error	LNK1120	1 unresolved externals	DelayPlugin_VST3	C:\Users\dvi\OneDrive\Bureaublad\DelayPlugin\DelayPlugin\Builds\VisualStudio2019\x64\Debug\VST3\DelayPlugin.vst3	1	

I tried restarting my visual studio… restarting my pc… changing plugin formats in projucer… didnt work. Anyone knows what could be the problem? I did not have this problem before

1 Like

This is a linker error. After compiling the individual translation units of your project (–> all the .cpp files) individually, the linker is the tool that runs afterwards in order to figure out where to find the implementation of functions that are called in one .cpp file but defined in another .cpp file. If it fails to find the definition of a function that you called somewhere it will emit an error like this. And indeed it’s very specific about what problem it finds. Learning to interpret compiler and linker error messages is a very important skill, so let’s have a look at your error message. I add a few linebreaks to it to make it a bit more readable and go through the error message line by line

Error	LNK2019	unresolved external symbol 

public: class juce::AudioProcessorValueTreeState::ParameterLayout __cdecl DelayPluginAudioProcessor::CreateParameterLayout(void)" (?CreateParameterLayout@DelayPluginAudioProcessor@@QEAA?AVParameterLayout@AudioProcessorValueTreeState@juce@@XZ) 

referenced in function 

"public: __cdecl DelayPluginAudioProcessor::DelayPluginAudioProcessor(void)" (??0DelayPluginAudioProcessor@@QEAA@XZ)	

DelayPlugin_StandalonePlugin	

C:\Users\dvi\OneDrive\Bureaublad\DelayPlugin\DelayPlugin\Builds\VisualStudio2019\DelayPlugin.lib(PluginProcessor.obj)	1	
  1. Error LNK2019 unresolved external symbol Each kind of error your linker or compiler can encounter has some kind of error code. This is LNK2019 in this case, but the error code itself is not as meaningful as the explanation that follows: It cannot resolve where to find some symbol that you referenced somewhere
  2. public: class juce::AudioProcessorValueTreeState::ParameterLayout __cdecl DelayPluginAudioProcessor::CreateParameterLayout(void)" (?CreateParameterLayout@DelayPluginAudioProcessor@@QEAA?AVParameterLayout@AudioProcessorValueTreeState@juce@@XZ) This is a mangled function name. If you want to learn more about mangling look e.g. here. For now let’s “unmangle” the name to something better readable: juce::AudioProcessorValueTreeState::ParameterLayout DelayPluginAudioProcessor::CreateParameterLayout()
  3. referenced in function means just that the symbol that was mention before which it could not find was called in the following function which is…
  4. … again a mangled function name. It will likely look like that in your code: DelayPluginAudioProcessor::DelayPluginAudioProcessor(), so it’s the constructor of your class DelayPluginAudioProcessor
  5. DelayPlugin_StandalonePlugin is the target that your linker is currently working on
  6. The actual underlying library file placed in some temporary build directory where your linker is working on it

Pulling all the surrounding information aside the relevant part of the error remains:

Hey, it’s your linker, I’m working on DelayPlugin_StandalonePlugin and encountered an error. You called the function DelayPluginAudioProcessor::CreateParameterLayout in the constructor of the DelayPluginAudioProcessor class, but I can’t find the implementation of that function in any of the .cpp files of your project.

Reasons for that can now differ. You might have just forgotten to implement it. It might be commented out accidentally. Or you might have implemented it in a .cpp file that you didn’t add to the project, so it’s not compiled.

Maybe this gives you enough pointers to figure out the source of the problem yourself. If not, you might want to post the code of your DelayPluginAudioProcessor class here

4 Likes

Thank you so much.

I implemented my function like:

juce::AudioProcessorValueTreeState::ParameterLayout  CreateParameterLayout()

but I forgot to add ‘DelayPluginAudioProcessor’

juce::AudioProcessorValueTreeState::ParameterLayout  DelayPluginAudioProcessor::CreateParameterLayout()

Thanks a lot :grinning:

2 Likes