0
votes

I've recently updated Xcode to version 10.0 and after that when I try to build version for iOS I've the following problem.

1:04:17: Running steps for project Diasteca... 11:04:17: Starting: "/Users/belladellifabio/Qt/5.11.1/ios/bin/qmake" /Users/belladellifabio/Desktop/QtProjects/Diasteca/mqtt_test/mqtt_test.pro -spec macx-ios-clang CONFIG+=iphoneos CONFIG+=device CONFIG+=qml_debug Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version. Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point. Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned! 11:04:18: The process "/Users/belladellifabio/Qt/5.11.1/ios/bin/qmake" exited normally. 11:04:18: Starting: "/usr/bin/make" qmake_all make: Nothing to be done for `qmake_all'. 11:04:18: The process "/usr/bin/make" exited normally. 11:04:18: Starting: "/usr/bin/make" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -fPIC -std=gnu++11 -arch arm64 -arch x86_64 -Xarch_arm64 -miphoneos-version-min=12.0 -Xarch_arm64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk -Xarch_x86_64 -mios-simulator-version-min=12.0 -Xarch_x86_64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk -fobjc-nonfragile-abi -fobjc-legacy-dispatch -fembed-bitcode-marker -Wall -W -DQT_COMPILER_SUPPORTS_SSE2 -DMQTT_TEST_LIBRARY -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../Diasteca/mqtt_test -I. -I../../../../Qt/5.11.1/ios/mkspecs/common/uikit -I../../../../Qt/5.11.1/ios/include -I../../../../Qt/5.11.1/ios/include/QtNetwork -I../../../../Qt/5.11.1/ios/include/QtCore/5.11.1 -I../../../../Qt/5.11.1/ios/include/QtCore/5.11.1/QtCore -I../../../../Qt/5.11.1/ios/include/QtCore -I. -I../../../../Qt/5.11.1/ios/mkspecs/macx-ios-clang -o qmqttclient.o ../../Diasteca/mqtt_test/qmqttclient.cpp clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk' [-Wmissing-sysroot] clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk' [-Wmissing-sysroot] In file included from ../../Diasteca/mqtt_test/qmqttclient.cpp:30: In file included from ../../Diasteca/mqtt_test/qmqttclient.h:33: In file included from ../../Diasteca/mqtt_test/qmqttglobal.h:33: In file included from ../../../../Qt/5.11.1/ios/include/QtCore/qglobal.h:47: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:202: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:61: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found

Probably the real problem is not the file not found error, but is connected to the fact that qty tries to build the app using an SDK that is no more installed on the system. Is this a qt problem? How could I specify the version of iOS SDK to use to build the app? Is it possible?

3
From your error message: "Running this project against other versions of the Qt modules may crash at any arbitrary point. This is not a bug, but a result of using Qt internals. You have been warned!"Yksisarvinen
@Yksisarvinen Looks like it is a deprecation error...Ruks

3 Answers

1
votes

Finally, I've found and delete .qmake.cache and .qmake.stash files. I've restart QtCreator and now it seems to work.

0
votes

Qt stores SDK information somewhere deep in the build output and the .pro.user file. Remove the user file (you might want to backup your user file in case you have custom build steps), the complete (shadow) build tree and modify your .pro file so that there is no such line as QMAKE_MAC_SDK = macosx10.13.

Then call qmake and build your project again, the inconsistency should be gone.

0
votes

This occurs when the iOS SDK that Qt is expecting is different than the iOS SDK that you have installed. For instance Qt 5.13.1 expects iPhoneOS13.1.sdk but my Xcode currently has iPhoneOS13.2.sdk:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
$ ls -l
total 0
drwxrwxr-x  7 root  wheel  224 Nov  5  2019 iPhoneOS.sdk
lrwxr-xr-x  1 root  wheel   12 Jan 15  2020 iPhoneOS13.2.sdk -> iPhoneOS.sdk
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
$ ls -l
total 0
drwxrwxr-x  8 root  wheel  256 Jul 22 14:14 iPhoneSimulator.sdk
lrwxr-xr-x  1 root  wheel   19 Jan 15  2020 iPhoneSimulator13.2.sdk -> iPhoneSimulator.sdk

To remedy this, we can get Qt to use the iPhoneOS13.2.sdk:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
$ ls -l
total 0
drwxrwxr-x  7 root  wheel  224 Nov  5  2019 iPhoneOS.sdk
lrwxr-xr-x  1 root  wheel   12 Jan 15  2020 iPhoneOS13.2.sdk -> iPhoneOS.sdk
$ sudo ln -s iPhoneOS.sdk iPhoneOS13.1.sdk
$ ls -l
total 0
drwxrwxr-x  8 root  wheel  256 Jul 22 14:20 iPhoneOS.sdk
lrwxr-xr-x  1 root  wheel   12 Jul 22 14:20 iPhoneOS13.1.sdk -> iPhoneOS.sdk
lrwxr-xr-x  1 root  wheel   12 Jan 15  2020 iPhoneOS13.2.sdk -> iPhoneOS.sdk
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
$ ls -l
total 0
drwxrwxr-x  8 root  wheel  256 Jul 22 14:14 iPhoneSimulator.sdk
lrwxr-xr-x  1 root  wheel   19 Jan 15  2020 iPhoneSimulator13.2.sdk -> iPhoneSimulator.sdk
$ sudo ln -s iPhoneSimulator.sdk iPhoneSimulator13.1.sdk
$ ls -l
total 0
drwxrwxr-x  8 root  wheel  256 Jul 22 14:14 iPhoneSimulator.sdk
lrwxr-xr-x  1 root  wheel   19 Jul 22 14:39 iPhoneSimulator13.1.sdk -> iPhoneSimulator.sdk
lrwxr-xr-x  1 root  wheel   19 Jan 15  2020 iPhoneSimulator13.2.sdk -> iPhoneSimulator.sdk