Linker Flag LTO errors Xcode and JUCE

Hello everyone !

I have been digging JUCE forum for about two days in hope to find a solution to my problem, but in vain. So I come here to seek your help, sorry if this topic has been discussed already, I haven’t find it :smiling_face_with_tear:

I am bascially really new to C++ and JUCE in general, but I am dedicated to learn. Since yersterday everything worked fine, but sudenly, none of the projects I try to build… Build. There is always these two errors. Tbh i got them at the ery beginning when installing JUCE but it disapeared quite quickly I don’t know how.
The errors i get are those ones:

"If you are using Link Time Optimisation (LTO), the new linker introduced in Xcode 15 may produce a broken binary.

As a workaround, add either ‘-Wl,-weak_reference_mismatches,weak’ or ‘-Wl,-ld_classic’ to your linker flags.

Once you’ve selected a workaround, you can add JUCE_SILENCE_XCODE_15_LINKER_WARNING to your preprocessor definitions to silence this warning."

and also:

"Static assertion failed due to requirement ‘std::string_view(“15.0.0 (clang-1500.0.40.1)”) != std::string_view(“15.0.0 (clang-1500.0.40.1)”)’: The new linker introduced in Xcode 15.0 will produce broken binaries when targeting older platforms.

To work around this issue, bump your deployment target to macOS 13 or iOS 15, re-enable the old linker by adding ‘-Wl,-ld_classic’ to your link flags, or update to Xcode 15.1.

Once you’ve selected a workaround, you can add JUCE_SILENCE_XCODE_15_LINKER_WARNING to your preprocessor definitions to silence this warning."

so i created in xcode a new configuration setting name and add the linker flags named above. But it doesn’t seems to work, i still have those errors going and it drives me crazy as I don’t know how to get rid of them.

Could anyone help me ?

Thanks again and sorry if this topic has been discussed already !

Getting the same thing here. Fails and gives me those 2 errors. Tried version 14 Xcode and it gave other errors.

try adding ‘-Wl,-ld_classic’ to your project’s link time options, can be found in projucer under exporters XCode (macOS) > extra linker flags

for some reason I have had issues setting configurations in xcode directly when using projucer managed projects, so i find it’s safest to apply via projucer

This is what I did to silence the warning:

Please follow the instructions in this post:

1 Like

I was on 7.0.5 with XCode 15.0. I experienced LTO errors once I upgraded to JUCE 7.0.8.

xcode 15.1 is now released