# Undefined symbol: createPluginFilter()

**URL:** <https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327>\
**Category:** General JUCE discussion\
**Created:** [August 5, 2023, 9:46pm UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327 "2023-08-05T21:46:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrinkingMoonlight](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DrinkingMoonlight](https://forum.juce.com/u/DrinkingMoonlight)\
**Post date:** [August 5, 2023, 9:46pm UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/1 "2023-08-05T21:46:09Z")

</div>

#include \<JuceHeader.h\>

#include “MoonlightGrainDelayAudioProcessor.h”

#include “MoonlightGrainDelayAudioProcessorEditor.h”

MoonlightGrainDelayAudioProcessor::MoonlightGrainDelayAudioProcessor()

{

// Initialize your parameters and member variables here (if any).

}

MoonlightGrainDelayAudioProcessor::~MoonlightGrainDelayAudioProcessor()

{

}

**void** MoonlightGrainDelayAudioProcessor::prepareToPlay( **double** sampleRate, **int** samplesPerBlock)

{

// Implement any initialization needed before audio processing starts.

}

**void** MoonlightGrainDelayAudioProcessor::releaseResources()

{

// Implement any cleanup here.

}

**void** MoonlightGrainDelayAudioProcessor::processBlock(juce::AudioBuffer\< **float** \>& buffer, juce::MidiBuffer& midiMessages)

{

// Implement your grain delay processing here.

// You can use the buffer to read/write audio data and midiMessages for MIDI data (if required).

}

juce::AudioProcessorEditor\* MoonlightGrainDelayAudioProcessor::createEditor()

{

**return**  **new** MoonlightGrainDelayAudioProcessorEditor(\ ***this** );

}

**bool** MoonlightGrainDelayAudioProcessor::hasEditor() **const**

{

**return**  **true** ;

}

**const** juce::String MoonlightGrainDelayAudioProcessor::getName() **const**

{

**return** “Moonlight Grain Delay V2”;

}

// here’s part of the code im building a grain delay plugin using c++  
but im getting this error:  
Undefined symbol: createPluginFilter()

---

<div class="post-metadata">

**Author:** ![DrinkingMoonlight](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DrinkingMoonlight](https://forum.juce.com/u/DrinkingMoonlight)\
**Post date:** [August 8, 2023, 8:48am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/2 "2023-08-08T08:48:01Z")

</div>

The createPluginFilter()  
Actually isn’t anywhere in my code but I’m still getting that error which makes me think it’s an issue with a linked file from juce or something

---

<div class="post-metadata">

**Author:** ![yfede](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yfede/32/506_2.png) [@yfede](https://forum.juce.com/u/yfede)\
**Post date:** [August 8, 2023, 9:12am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/3 "2023-08-08T09:12:33Z")

</div>

JUCE expects that you define it yourself, and make it return the pointer to a new instance of your AudioProcessor. That’s how JUCE knows what AudioProcessor it must wrap with its various plug-in wrappers, and that’s why it expects the symbol to be defined.

Put in your .cpp file something like this:

```auto
//==============================================================================
// This creates new instances of the plugin..
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
    return new MoonlightGrainDelayAudioProcessor();
}

```

---

<div class="post-metadata">

**Author:** ![DrinkingMoonlight](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DrinkingMoonlight](https://forum.juce.com/u/DrinkingMoonlight)\
**Post date:** [August 8, 2023, 5:31pm UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/4 "2023-08-08T17:31:43Z")

</div>

Hey thank you so much! Where in the cpp should I put it?  
I have a pluginProcessor.cpp and a pluginEditor.cpp

---

<div class="post-metadata">

**Author:** ![yfede](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yfede/32/506_2.png) [@yfede](https://forum.juce.com/u/yfede)\
**Post date:** [August 9, 2023, 8:09am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/5 "2023-08-09T08:09:48Z")

</div>

To the compiler, it doesn’t matter much where that function is defined, as long as the linker can find it.

Conceptually, I’d say it belongs to the pluginProcessor.cpp file, and that’s where I would put it.

Inside that file, any place after the #include directives is good. If you place it at the very end of the file, you can be sure that whatever definition you need inside that function, it has already been provided by the code above it.

---

<div class="post-metadata">

**Author:** ![DrinkingMoonlight](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DrinkingMoonlight](https://forum.juce.com/u/DrinkingMoonlight)\
**Post date:** [August 10, 2023, 1:39am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/6 "2023-08-10T01:39:23Z")

</div>

#include \<JuceHeader.h\>

#include “MoonlightGrainDelayAudioProcessor.h”

#include “MoonlightGrainDelayAudioProcessorEditor.h”

MoonlightGrainDelayAudioProcessor::MoonlightGrainDelayAudioProcessor()

{

// Initialize your parameters and member variables here (if any).

}

MoonlightGrainDelayAudioProcessor::~MoonlightGrainDelayAudioProcessor()

{

}

**void** MoonlightGrainDelayAudioProcessor::prepareToPlay( **double** sampleRate, **int** samplesPerBlock)

{

// Implement any initialization needed before audio processing starts.

}

**void** MoonlightGrainDelayAudioProcessor::releaseResources()

{

// Implement any cleanup here.

}

**void** MoonlightGrainDelayAudioProcessor::processBlock(juce::AudioBuffer\< **float** \>& buffer, juce::MidiBuffer& midiMessages)

{

// Implement your grain delay processing here.

// You can use the buffer to read/write audio data and midiMessages for MIDI data (if required).

}

juce::AudioProcessorEditor\* MoonlightGrainDelayAudioProcessor::createEditor()

{

**return**  **new** MoonlightGrainDelayAudioProcessorEditor(\ ***this** );

}

**bool** MoonlightGrainDelayAudioProcessor::hasEditor() **const**

{

**return**  **true** ;

}

**const** juce::String MoonlightGrainDelayAudioProcessor::getName() **const**

{

**return** “Moonlight Grain Delay V2”;

}

juce::AudioProcessor\* JUCE\_CALLTYPE createPluginFilter()

{

**return**  **new** MoonlightGrainDelayAudioProcessor();

}

// when I added this at the end of the file you recommended I received this error:  
/Users/chandler/Documents/CODING/Moonlight Grain Delay/Moonlight Grain Delay

V2/NewProject/Source/MoonlightGrainDelayAudioProcessor.cpp:47:16 Allocating an object of abstract class type ‘MoonlightGrainDelayAudioProcessor’

---

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [August 10, 2023, 6:21am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/7 "2023-08-10T06:21:21Z")

</div>

Just a note that you can format code by putting 3 backticks before and after the code (`). 🙂

---

<div class="post-metadata">

**Author:** ![yfede](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yfede/32/506_2.png) [@yfede](https://forum.juce.com/u/yfede)\
**Post date:** [August 10, 2023, 8:11am UTC](https://forum.juce.com/t/undefined-symbol-createpluginfilter/57327/8 "2023-08-10T08:11:17Z")

</div>

> [@DrinkingMoonlight](#):
>
> V2/NewProject/Source/MoonlightGrainDelayAudioProcessor.cpp:47:16 Allocating an object of abstract class type ‘MoonlightGrainDelayAudioProcessor’

That means that your class MoonlightGrainDelayAudioProcessor should provide a function definition for some of the functions that are pure virtual in the base class AudioProcessor.  
The name(s) of the functions that are missing a definition, should appear in the informations that precede or follow the error message quoted above.

If that is new to you, I suggest you improve your general knowledge of the basics of C++ before you dive into developing with JUCE, otherwise it all may end up looking more complicated than it really is.
