Compiling a libGDX project for iOS: Native linking failed-Collection of common programming errors

I am currently developing a small multiplatform game with libGDX. The game works great on Windows, Android and OSX, but I can’t make it compile for iOS.

The libGDX guide for iOS states a couple of caveats, but I’m pretty sure I have taken everything into account. I have Eclipse, Xamarin.iOS, JDK, Ant, and $PATH, $IKVM_HOME is set as they should. The gamename.dll (which is the Mono compiled dll that contains all my game logic, and is automatically generated from the Java code) has been created, and everything looks to be in order.

When compiling, however, I get the following error message:

Error MT5201: Native linking failed. Please review user flags provided to gcc: "-L/Users/blah/Ultralyd/Ultralyd-ios/libs/ios" "-L/Users/blah/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin" "-likvm-natives" "-lgdx" "-force_load" "/Users/blah/Ultralyd/Ultralyd-ios/libs/ios/libgdx.a" "-force_load" "/Users/blah/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin/libikvm-natives.a" (MT5201)

(Paths abbreviated a little bit for brevity.)

These arguments are automatically generated by libGDX when creating the iOS project, and looks like this in Xamarin’s project settings:

-nosymbolstrip -nostrip -cxx -gcc_flags "-L${ProjectDir}/libs/ios -L${ProjectDir}/libs/ios/ikvm/bin -likvm-natives -lgdx -force_load ${ProjectDir}/libs/ios/libgdx.a -force_load ${ProjectDir}/libs/ios/ikvm/bin/libikvm-natives.a"

The build output contains this:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++  -Wl,-no_pie -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=3.2 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk  /Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.cache.vqL1439yU4Eq3JVRLyBeXkLz910=.o -o /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp1da69439.tmp/iosgame -framework CFNetwork -framework Foundation -framework OpenGLES -framework UIKit -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework OpenAL -framework AudioToolbox -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch-debug -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -u _catch_exception_raise  -force_load /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp1da69439.tmp/libObjectAL-universal.a "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin" "-likvm-natives" "-lgdx" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/libgdx.a" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin/libikvm-natives.a"
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++  -Wl,-no_pie -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=3.2 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk  /Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.cache.vqL1439yU4Eq3JVRLyBeXkLz910=.o -o /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp1da69439.tmp/iosgame -framework CFNetwork -framework Foundation -framework OpenGLES -framework UIKit -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework OpenAL -framework AudioToolbox -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch-debug -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -u _catch_exception_raise  -force_load /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp1da69439.tmp/libObjectAL-universal.a "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin" "-likvm-natives" "-lgdx" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/libgdx.a" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin/libikvm-natives.a"
Undefined symbols for architecture i386:
  "_AVAudioSessionInterruptionNotification", referenced from:
      -[OALAudioSession init] in libObjectAL-universal.a(OALAudioSession.o)
  "_AVAudioSessionInterruptionTypeKey", referenced from:
      -[OALAudioSession handleInterruption:] in libObjectAL-universal.a(OALAudioSession.o)
  "_AVAudioSessionInterruptionOptionKey", referenced from:
      -[OALAudioSession handleInterruption:] in libObjectAL-universal.a(OALAudioSession.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

libObjectAL is one of the referenced dlls that was added automatically by libGDX when creating the project.

I assume this means that there is something wrong with my settings, but I can’t find anything that looks like it is related.

Any ideas?

EDIT: After adding the framework suggested by poupou, I now get a slightly different error message: EDIT1b: No, it’s actually the same. The only difference are the arguments.

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++  -Wl,-no_pie -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=3.2 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk  /Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.cache.1rmDllI2qRyDYwNzBd+9+oPccNg=.o -o /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp141160e6.tmp/iosgame -framework CFNetwork -framework Foundation -framework OpenGLES -framework UIKit -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework OpenAL -framework AudioToolbox -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch-debug -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -u _catch_exception_raise  -force_load /var/folders/4p/g1k6g_v51kn35jm5yyh3g74m0000gq/T/tmp141160e6.tmp/libObjectAL-universal.a "-framework" "AVFoundation" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin" "-likvm-natives" "-lgdx" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/libgdx.a" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin/libikvm-natives.a"
Undefined symbols for architecture i386:
  "_AVAudioSessionInterruptionNotification", referenced from:
      -[OALAudioSession init] in libObjectAL-universal.a(OALAudioSession.o)
  "_AVAudioSessionInterruptionTypeKey", referenced from:
      -[OALAudioSession handleInterruption:] in libObjectAL-universal.a(OALAudioSession.o)
  "_AVAudioSessionInterruptionOptionKey", referenced from:
      -[OALAudioSession handleInterruption:] in libObjectAL-universal.a(OALAudioSession.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

error MT5201: Native linking failed. Please review user flags provided to gcc: "-framework" "AVFoundation" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios" "-L/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin" "-likvm-natives" "-lgdx" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/libgdx.a" "-force_load" "/Users/erlenddahl/Copy/UltralydDebugging/Libgdx/Ultralyd/Ultralyd-ios/libs/ios/ikvm/bin/libikvm-natives.a"