macOS linker errors when updating from JUCE 7.0.7 to 7.0.10

If I update my JUCE modules from 7.0.7 to 7.0.10, Windows compilation goes fine, but macOS throws the following linker errors (XCode 15.2). Anyone know what’s going on?

I use these modules in my project:

  • audio basics
  • audio devices
  • core
  • data structures
  • events
  • graphics
  • gui basics

The errors:

ld: Undefined symbols:
  juce::imageToNSImage(juce::ScaledImage const&), referenced from:
      juce::MouseCursor::SharedCursorHandle::createStandard(juce::MouseCursor::StandardCursorType) in lto.o
      juce::NSViewComponentPeer::setIcon(juce::Image const&) in lto.o
  juce::CoreGraphicsContext::CoreGraphicsContext(CGContext*, float), referenced from:
      juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, CGRect)::__invoke(objc_object*, objc_selector*, CGRect) in lto.o
  juce::CoreGraphicsContext::~CoreGraphicsContext(), referenced from:
      juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, CGRect)::__invoke(objc_object*, objc_selector*, CGRect) in lto.o
      juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, CGRect)::__invoke(objc_object*, objc_selector*, CGRect) in lto.o
  juce::juce_getImageContext(juce::Image const&), referenced from:
      juce::detail::WindowingHelpers::createIconForFile(juce::File const&) in lto.o
  juce::juce_loadWithCoreImage(juce::InputStream&), referenced from:
      juce::GIFImageFormat::decodeImage(juce::InputStream&) in lto.o
      juce::JPEGImageFormat::decodeImage(juce::InputStream&) in lto.o
      juce::PNGImageFormat::decodeImage(juce::InputStream&) in lto.o
  juce::juce_createCoreGraphicsImage(juce::Image const&, CGColorSpace*), referenced from:
      juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, CGRect)::__invoke(objc_object*, objc_selector*, CGRect) in lto.o
  juce::NativeImageType::create(juce::Image::PixelFormat, int, int, bool) const, referenced from:
      juce::RenderingHelpers::StackBasedLowLevelGraphicsContext<juce::RenderingHelpers::SoftwareRendererSavedState>::beginTransparencyLayer(float) in lto.o
      juce::Image::Image(juce::Image::PixelFormat, int, int, bool) in lto.o
      juce::DropShadow::drawForPath(juce::Graphics&, juce::Path const&) const in lto.o
      vtable for juce::NativeImageType in lto.o

Did you do a full clean and rebuild when you did the upgrade, or did you just try to compile your project against the new libraries? Was your project generated with Projucer in 7.0.7 and then you tried to load it with 7.0.10? Don’t forget, if you upgrade JUCE, you also have to re-generate your projects from the .jucer files with the newer version of Projucer, too …

Interesting. I had regenerated the project and cleaned the build folder before. This time, before regeneration, I deleted all the generated files. Now everything works fine. Thanks for your help.

1 Like