Undefined symbols for architecture arm64 when building

Hi guys.

I’m new to JUCE, I’ve seen similar topics in the Forum but I’m not able to make the solutions work in my case.

I did build the SimpleEQ following the freeCodeCamp YouTube course and now I’m trying to add more Parametric bands to it.

When I try to build I’m getting this error message

Ld /Users/nicolas/Programming/RamEQ/Builds/MacOSX/build/Debug/RamEQ.app/Contents/MacOS/RamEQ normal (in target 'RamEQ - Standalone Plugin' from project 'RamEQ')
    cd /Users/nicolas/Programming/RamEQ/Builds/MacOSX
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-macos10.13 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -L/Users/nicolas/Programming/RamEQ/Builds/MacOSX/build/Debug -F/Users/nicolas/Programming/RamEQ/Builds/MacOSX/build/Debug -filelist /Users/nicolas/Library/Developer/Xcode/DerivedData/RamEQ-aazhmqvkvmmmcnfavaqmvhyctusx/Build/Intermediates.noindex/RamEQ.build/Debug/RamEQ\ -\ Standalone\ Plugin.build/Objects-normal/arm64/RamEQ.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/nicolas/Library/Developer/Xcode/DerivedData/RamEQ-aazhmqvkvmmmcnfavaqmvhyctusx/Build/Intermediates.noindex/RamEQ.build/Debug/RamEQ\ -\ Standalone\ Plugin.build/Objects-normal/arm64/RamEQ_lto.o -Xlinker -no_deduplicate -stdlib\=libc++ -lRamEQ -weak_framework Metal -weak_framework MetalKit -framework Accelerate -framework AudioToolbox -framework Cocoa -framework CoreAudio -framework CoreAudioKit -framework CoreMIDI -framework DiscRecording -framework Foundation -framework IOKit -framework QuartzCore -framework WebKit -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/nicolas/Library/Developer/Xcode/DerivedData/RamEQ-aazhmqvkvmmmcnfavaqmvhyctusx/Build/Intermediates.noindex/RamEQ.build/Debug/RamEQ\ -\ Standalone\ Plugin.build/Objects-normal/arm64/RamEQ_dependency_info.dat -o /Users/nicolas/Programming/RamEQ/Builds/MacOSX/build/Debug/RamEQ.app/Contents/MacOS/RamEQ

Undefined symbols for architecture arm64:
  "makeHFPeakFilter(ChainSettings const&, double)", referenced from:
      RamEQAudioProcessor::updateHFPeakFilter(ChainSettings const&) in libRamEQ.a(PluginProcessor.o)
      ResponseCurveComponent::updateChain() in libRamEQ.a(PluginEditor.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone know how to fix this?

Thanks!

I’m on a MacBook Pro 13" with M1. I’m building AU, VST3 and Standalone for now (even though I’d like to make an AAX version later on)

Is makeHFPeakFilter part of a third-party library? If so, then you likely need an arm64 build of that library.

I don’t think it is (sorry I’m new to C++),

I declare it in PluginProcessor.h like this :

using Coefficients = Filter::CoefficientsPtr;

Coefficients makeHFPeakFilter(const ChainSettings& chainSettings, double sampleRate);

And in PluginProcessor.cpp, I use it like that :

void RamEQAudioProcessor::updateHFPeakFilter(const ChainSettings &chainSettings)
{
auto hfpeakCoefficients = makeHFPeakFilter(chainSettings, getSampleRate());

leftChain.setBypassed<ChainPositions::HFPeak>(chainSettings.hfpeakBypassed);
rightChain.setBypassed<ChainPositions::HFPeak>(chainSettings.hfpeakBypassed);

updateCoefficients(leftChain.get<ChainPositions::HFPeak>().coefficients, hfpeakCoefficients);
updateCoefficients(rightChain.get<ChainPositions::HFPeak>().coefficients, hfpeakCoefficients);

}

This type of error usually means that the signature of the definition (in the .cpp file) doesn’t match the signature of the declaration (in the .h file).

For instance, it’s quite common to forget the class scope when defining a member function. In your case, maybe RamEQAudioProcessor:: is missing in the definition of makeHFPeakFilter.

I hope this helps!

You’re right! I made a mistake and forgot to define makeHFPeakFilter in RamEQAudioProcessor. Everything works fine now!

Thanks a lot !