IOS Linker error when building openfl_sample projects

Hi there

When i try to build the NyanCat example that comes with openfl_samples the build process fails when trying to build for ios.

I use the command: openfl build ios -debug

But the following error:

Undefined symbols for architecture arm64:
OBJC_CLASS$_GCController”, referenced from:
objc-class-ref in liblime.a(d9029685_SDL_sysjoystick.o)
"_GCControllerDidConnectNotification", referenced from:
_SDL_SYS_JoystickInit in liblime.a(d9029685_SDL_sysjoystick.o)
_SDL_SYS_JoystickQuit in liblime.a(d9029685_SDL_sysjoystick.o)
"_GCControllerDidDisconnectNotification", referenced from:
_SDL_SYS_JoystickInit in liblime.a(d9029685_SDL_sysjoystick.o)
_SDL_SYS_JoystickQuit in liblime.a(d9029685_SDL_sysjoystick.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas?

Thanks in advance.
Mikkel

1 Like

Hmmm… seems like I get the same errors when trying to build some of the other examples, like DisplayingABitmap or AddingText.

Obviously I must be doing something wrong, just don’t know what.

I’m on a Mac, have installed:

  • Haxe 3.2.1
  • Open-fl haxelib
  • Lime haxelib
  • XCode
  • XCode Command line tools installed

Do I need anything else?

Thanks in advance
Mikkel

Ok, I somehow managed to get this one fixed. Adding the following to the project.xml does the trick:

<dependency name="GameController.framework" if="ios"/>

So maybe this dependency was introduced at some point in the openfl framework?

2 Likes

Ok, this seems to have been reported already in https://github.com/openfl/lime/issues/688

Now I managed to ad the missing GameController.framework to XCode template, which makes it unnecessary to add it in the openfl project.xml.

For those interested the fix, it’s included in this pull request: https://github.com/openfl/lime/pull/689

But, since I’m rather new to OpenFL, I’m not 100% sure if this is the correct way of fixing this issue. Maybe some of the common contributors can answer this?

1 Like

pulled the fix in today :slight_smile:

1 Like

Great!, then I must have done something right :slight_smile: