Undefined Symbol Error

I’m getting the following error when compiling:

Undefined symbol: void FormantFilter::process<juce::dsp::ProcessContextReplacing<float> >(juce::dsp::ProcessContextReplacing<float> const&)

I’m trying to see if an array of bandpass filters I created is working by just running sound through one of them.

FormantFilter.process() is:

template <typename ProcessContext> void FormantFilter::process(const ProcessContext& context)
{
    filters[0]->process(context);
}

In the header file:
template <typename ProcessContext> void process(const ProcessContext& context);

and then processBlock is:

void FormantFilterAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
    juce::ScopedNoDenormals noDenormals;
    auto totalNumInputChannels  = getTotalNumInputChannels();
    auto totalNumOutputChannels = getTotalNumOutputChannels();

    for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
        buffer.clear (i, 0, buffer.getNumSamples());

    juce::dsp::AudioBlock<float> ioBuffer (buffer);
    
    juce::dsp::ProcessContextReplacing<float> context (ioBuffer);
    
    filter.process(context);
}

The build works just fine if I comment out

filter.process(context);

But I genuinely have no idea why it isn’t compiling. It seems to me like I’m calling filter.process with the exact argument it is expecting.

You need to move the definition of process to the header. Normally, template code requires that the definition of the template is visible in each translation unit (source file) that uses that template.