Page 1 of 2

iOS Build xCode 12 Errors

Posted: Sat Sep 19, 2020 12:28 am
by segdirbnab
Has anybody successfully built their LOVE game for iOS using xCode 12?

I'm receiving a host of errors relating to math.h. They all take the form of:

Code: Select all

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:769:10: No member named 'labs' in the global namespace; did you mean simply 'labs'?"
/Users/blank/Downloads/love-11.3-ios-source/src/libraries/glad/glad.cpp:13:10: In file included from /Users/blank/Downloads/love-11.3-ios-source/src/libraries/glad/glad.cpp:13:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/assert.h:44:10: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/assert.h:44:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:100:10: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:100:
 
Any ideas? I've tried reinstalling xCode and the command line tools, but no go.

Thanks!

Re: iOS Build xCode 12 Errors

Posted: Mon Sep 21, 2020 7:46 pm
by terribleben
I am seeing the same issue. I haven't found a solution, but I think this thread is relevant: https://stackoverflow.com/questions/586 ... nbit-in-th

Here's a quote from that thread:
To summarise: On Catalina, /usr/include is purged and protected by SIP. Thus, any project that expects the C headers to be found there will fail to compile. If I remember correctly, Apple recommends to file bug reports to projects that expect C headers in /usr/include.
In the case of Love2d and Xcode, I tried changing the `-isysroot` flag to the value of `xcrun --show-sdk-path` (or `xcrun --show-sdk-path -sdk iphoneos` for iOS) and this didn't fix the issue. I will post again if I find a solution.

For reference, my machine is on Catalina 10.15.6 and Xcode 12.0. I just updated Xcode today and the issue appeared.

Re: iOS Build xCode 12 Errors

Posted: Tue Sep 22, 2020 1:23 am
by slime
I pushed this change to the github repository which should fix it, let me know if it works for you: https://github.com/love2d/love/commit/6 ... 4677a0cd7e

You can either duplicate those changes into your copy of love's source, or grab the latest source from github and put the library dependencies in the new copy.

Re: iOS Build xCode 12 Errors

Posted: Tue Sep 22, 2020 4:06 pm
by terribleben
This fix works for me, thanks!

Re: iOS Build xCode 12 Errors

Posted: Wed Sep 23, 2020 5:00 pm
by segdirbnab
Thanks slime!

Re: iOS Build xCode 12 Errors

Posted: Wed Sep 30, 2020 1:45 pm
by janbaerts
Thanks, you saved my afternoon!

Re: iOS Build xCode 12 Errors

Posted: Sun Oct 25, 2020 6:13 pm
by anthonyk1225
slime wrote: Tue Sep 22, 2020 1:23 am I pushed this change to the github repository which should fix it, let me know if it works for you: https://github.com/love2d/love/commit/6 ... 4677a0cd7e
Thanks a lot, slime. You saved me from hours of keyboard head bashing.

Re: iOS Build xCode 12 Errors

Posted: Wed Nov 25, 2020 10:33 pm
by Makoren
I'm still getting this error in LÖVE version 11.3 and Xcode version 12.2. I'm also using an M1 Mac mini, which could be related.

EDIT: Got it working, just needed to clone the latest source from GitHub rather than grabbing it from the releases page.

Re: iOS Build xCode 12 Errors

Posted: Sun Mar 28, 2021 11:34 pm
by corey_marr
I verified @markoren trick of cloning vs. downloading the source from the releases page resolved the compiler errors on Xcode 12.4

Re: iOS Build xCode 12 Errors

Posted: Sun Dec 05, 2021 4:58 pm
by gingerbeardman
Thanks for this hotfix! using it with Xcode 13.1

I guess compatibility changes like this are going to creep in since love 11.3 was released over 2 years ago now.