Compiling for iOS

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By compassdevs

Hello,

I’m trying to compile my own templates (Godot 3.3.2) this is what i get following the docs:

→ scons p=iphone tools=no target=release arch=arm

scons: Reading SConscript files …
Checking for C header file mntent.h… no
scons: done reading SConscript files.
scons: Building targets …
[Initial build] Compiling ==> platform/iphone/godot_iphone.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/os_iphone.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/main.m
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/app_delegate.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/view_controller.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/ios.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/joypad_iphone.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/godot_view.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/display_layer.mm
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
[Initial build] Compiling ==> platform/iphone/godot_app_delegate.m
clang: warning: optimization flag ‘-fomit-frame-pointer’ is not supported for target ‘armv7’ [-Wignored-optimization-argument]
platform/iphone/godot_app_delegate.m:437:24:{437:16-437:23}{437:24-437:64}: error: no visible @interface for ‘ApplicationDelegateService’ (aka ‘NSObject’) declares the selector ‘application:handlerForIntent:’ [5]
id result = [service application:application handlerForIntent:intent];
~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and if i use arm64
scons p=iphone tools=no target=release arch=arm64

scons: Reading SConscript files …
Checking for C header file mntent.h… no
scons: done reading SConscript files.
scons: Building targets …
[Initial build] Compiling ==> platform/iphone/godot_iphone.mm
[Initial build] Compiling ==> platform/iphone/os_iphone.mm
[Initial build] Compiling ==> platform/iphone/main.m
[Initial build] Compiling ==> platform/iphone/app_delegate.mm
[Initial build] Compiling ==> platform/iphone/view_controller.mm
[Initial build] Compiling ==> platform/iphone/ios.mm
[Initial build] Compiling ==> platform/iphone/joypad_iphone.mm
[Initial build] Compiling ==> platform/iphone/godot_view.mm
[Initial build] Compiling ==> platform/iphone/display_layer.mm
[Initial build] Compiling ==> platform/iphone/godot_app_delegate.m
platform/iphone/godot_app_delegate.m:437:24:{437:16-437:23}{437:24-437:64}: error: no visible @interface for ‘ApplicationDelegateService’ (aka ‘NSObject’) declares the selector ‘application:handlerForIntent:’ [5]
id result = [service application:application handlerForIntent:intent];
~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [platform/iphone/godot_app_delegate.iphone.opt.arm64.o] Error 1
scons: building terminated because of errors.

no warnings in the latter but it stops on the same error

What version of Xcode or CommandLine Tools do you use? What version of scons?
I’ve seen that kind of error when trying to compile using a different version of libraries from the one that was in use when Godot was released.

You have to check when Godot 3.3.2 was released and then check SDK that was in use at the same time, any following update could break it. Be careful to use the very same approach with scons.

You can get the right SDKs from Apple Developer website. You don’t need to download the full Xcode, command line tools are enough.

gioele | 2021-07-27 23:19