Link error building release iOS


#1

Hi, getting this link error when building release version of iOS app. Debug is fine, as are MacOS. Any ideas? thx


#2

Have you tried disabling Link-Time Optimisation? (see Compile standalone Linux, undefined references to juce::<many_things> for a similar issue)


#3

thx for the suggestion - giving it a go now!


#4

Same error, albeit no longer from the lto module:


#5

I can’t reproduce this. Can you try the JUCE ‘audio plugin demo’ project? It builds fine in release on my machine with LTO enabled and disabled.


#6

Hi, managed to reproduce it on the demo project by setting compiler to latest so I can use C++17 features - must be what triggered the error in my own project. Debug builds fine, release has the error.


#7

The compiler knows about those functions (and wants to use them in an optimised build), but the iOS version of libc++ lacks them. I’m not sure what the best approach is…


#8

Surely that would affect debug too?

Is the result of this that we can’t use C++17 for iOS?


#9

It appears that with optimisations enabled the compiler is attempting to use certain aligned versions of new and delete which are not present in the accompanying c++ library.


#10

You’ll need to set the deployment target to iOS 11.0


#12

can’t do that really - lots of my users still use older tablets that stop at 9.3. Preferable to remove all C++17 code than to update the supported version of iOS. Before that though I might try turning off the optimiser for release builds. It’s a shame the appstore won’t allow different builds for different iOS versions.


#13

Turning off the optimiser and LTO has no effect - have to actually enable debug build in order to get a successful build.


#14

Do you think I should raise an issue with Apple for this?


#15

Possibly. I did a brief search of the web and I didn’t find anything concrete about C++17 support on specific versions of iOS.


#16

I raised an issue a few hours back - will update when I get a response, hopefully some time in 2018 :wink: