How to compile an iOS application in Qt?
-
@Mikeeeeee
you're definitely using the wrong compiler there.
AFAIK, there is no x86 compiler for iOS (accept for the iOS simulator) -
Can you show the compilers and Qt versions tab content.
-
Xcode creates projects and runs them in the simulator. How do I connect Apple Clang compiler and simulator from Xcode?
I guess you can do this by selecting the device in Xcode - after connecting with USB. I think you haven't installed the iOS component of Qt properly. You can try to delete/reinstall Qt. Close QtCreator then start Qt/MaintenanceTool.app/Contents/MacOS/MaintenanceTool
Use "Add or remove components" then on the screen where you can select the components to install just ensure that iOS is enabled (and also the Android versions you want to use). -
@Mikeeeeee said in How to compile an iOS application in Qt?:
Does the compiler for iOS come with Qt or need to be customized?
No, it comes with XCode from Apple and there is no need to customise it.
-
Looks like the compiler didn't tune in automatically. How to add a new compiler for iOS?
@Mikeeeeee Are you sure your XCode is set up properly (meaning support for iOS development installed)?
Do you see "Apple Clang (arm64)" as compiler on the "Compilers" tab? -
@Mikeeeeee I'm talking about Compile tab in QtCreator, not XCode.
-
Did you check your Xcode configuration to see if there's anything related to that ?
-
@Mikeeeeee You can open XCode and create a default app for iOS and see whether you can build it. I already suggested this before.
-
Xcode manages the changes automatically so I don't know whether there were any config changes or installations when I first connected my developer iOS device with USB to the MacOS machine. As I remember Qt picked up the config from Xcode automatically as well. Each QT version has a list of supported devices. You should use that specific QT version which contains your phone's architecture in its supported platforms page.
Execute the following command from terminal to see whether you have the same compiler as me:
find /Applications/Xcode.app/Contents/Developer/Toolchains -name clang++For me it lists:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++This same compiler is in use for both armv7 and x86_64, which is specified with the flag "-arch armv7" or "-arch x86_64".