iOS Build xCode 12 Errors

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
segdirbnab
Prole
Posts: 2
Joined: Sat Sep 19, 2020 12:17 am

iOS Build xCode 12 Errors

Post 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!
terribleben
Prole
Posts: 2
Joined: Sat Nov 16, 2019 1:51 am

Re: iOS Build xCode 12 Errors

Post 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.
User avatar
slime
Solid Snayke
Posts: 2954
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: iOS Build xCode 12 Errors

Post 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.
terribleben
Prole
Posts: 2
Joined: Sat Nov 16, 2019 1:51 am

Re: iOS Build xCode 12 Errors

Post by terribleben »

This fix works for me, thanks!
segdirbnab
Prole
Posts: 2
Joined: Sat Sep 19, 2020 12:17 am

Re: iOS Build xCode 12 Errors

Post by segdirbnab »

Thanks slime!
janbaerts
Prole
Posts: 1
Joined: Wed Sep 30, 2020 1:43 pm

Re: iOS Build xCode 12 Errors

Post by janbaerts »

Thanks, you saved my afternoon!
anthonyk1225
Prole
Posts: 1
Joined: Sun Oct 25, 2020 6:11 pm

Re: iOS Build xCode 12 Errors

Post 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.
Makoren
Prole
Posts: 2
Joined: Tue Sep 25, 2018 6:36 am

Re: iOS Build xCode 12 Errors

Post 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.
corey_marr
Prole
Posts: 1
Joined: Sun Mar 28, 2021 11:31 pm

Re: iOS Build xCode 12 Errors

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot], MrFariator and 36 guests