Undefined symbol ___isPlatformVersionAtLeast across XCode versions

I've been getting reports from team members of a build error:


Undefined symbols for architecture x86_64:

"___isPlatformVersionAtLeast", referenced from:

and then the location of some small code function that hasn't changed for weeks.


Eventually I've worked out that I've built a framework (that includes the 'problem' code) with XCode 11 GM and my colleagues have XCode 10.


The code in the framework triggering the problem appears to be:


  if (@available(iOS 11,*))
  {
       jsonOptions |= NSJSONWritingSortedKeys;
  }


[the @available... in particular]


If I build the framework in XCode 10 and give them the .framework bundle to drop into their build it all works fine, and if I take that framework bundle and build on XCode 11 GM it is all fine. Just the framework building on XCode 11 GM (with deployment target of iOS10) that can't be linked by a project built in XCode 10.


Questions:


1) Is anyone else seeing this?

2) Is this a known issue? If so is it intended that a framework built with XCode 11 can't be used in an XCode 10 built project?


Thanks,

Richard

Replies

Updated to add:


It appears to be any @available test that is greater than the deployment target that triggers XCode 11 to insert a reference to the symbol that XCode 10 can't find. Doesn't need to be any body inside the `if (@available(iOS 11,*))` either to trigger the problem.

So how can we fix it ?

Or we need to use xcode 11 whenerver we have this macro (@available) ....


Thanks

Build frameworks in XCode 10.3 if you need to support users still on XCode 10?


Just re-checked on the latest XCode Version 11.1 (11A1027) and the problem is still there.