Failed to load platform plugin "ios"
I have compiled Qt 5.1 Beta for iOS myself following the instructions here: http://blog.qt.digia.com/blog/2013/03/05/qt-for-ios-preview/ The included demo builds and runs fine, but I have a problem when trying to run a new project.
The project has been made with Xcode 4.6.2. It builds fine for the iOS Simulator using the following libraries and frameworks:
Foundation.framework, CoreFoundation.framework, CoreGraphics.framework, CoreText.framework, QuartzCore.framework, libqiosmain.a, libQt5Core.a, libQt5Gui.a, libQt5PlatformSupport.a, libQt5Widgets.a, libz.1.2.5.dylib
But when I run the application on the simulator, I get the following error:
"Failed to load platform plugin "ios". Available platforms are: "
Do I need any other libraries than the ones I am linking to?
u can check with ldd command if u're missing some libs
Using otool (OS X's version of ldd), I see that there are no unsatisfied shared dependencies.
hmm , should work, i will also try 5.1 version as I want to test for iOS, I will try to reproduce here the results ;)
I'm facing the same problem.
So, what is the solution?
There's a bug (feature?) in the 'iOS' platform plugin shipped with the "official" Qt5.1 release that requires it to be 'force loaded' in order to link properly. You will need to add -force_load libqios.a to "Other Linker Flags" in Xcode.
This bug is not present in the Qt4iOS version of the Qt5.1 release, which can be downloaded as a prebuilt SDK from: http://www.mediator-software.com.
I found this very useful article on linking Qt static libraries on iOS from Xcode that addresses this issue:
See the comments regarding the linker flag: