Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtMQTT build for iOS error



  • Hi, i want to build qtmqtt module for iOS. For MacOS and Android building process works fine but or iOS i get this:

    qmake:

    MacBook-Pro-760:build user$  ~/Qt/5.14.2/ios/bin/qmake -r ..
    Info: creating stash file /Users/macbook/Desktop/qtmqtt/build/.qmake.stash
    Info: creating cache file /Users/macbook/Desktop/qtmqtt/build/.qmake.cache
    Reading /Users/macbook/Desktop/qtmqtt/src/src.pro [/Users/macbook/Desktop/qtmqtt/build/src]
     Reading /Users/macbook/Desktop/qtmqtt/src/mqtt/mqtt.pro [/Users/macbook/Desktop/qtmqtt/build/src/mqtt]
    Project MESSAGE: perl -w /Users/macbook/Qt/5.14.2/ios/bin/syncqt.pl -module QtMqtt -version 5.14.2 -outdir /Users/macbook/Desktop/qtmqtt/build -builddir /Users/macbook/Desktop/qtmqtt/build /Users/macbook/Desktop/qtmqtt
    <srcbase> = /Users/macbook/Desktop/qtmqtt 
    <bldbase> = /Users/macbook/Desktop/qtmqtt/build 
    <outbase> = /Users/macbook/Desktop/qtmqtt/build 
    QtMqtt: created fwd-include header(s) for <srcbase>/src/mqtt/ { qmqttauthenticationproperties.h (2), qmqttclient.h (2), qmqttclient_p.h (1), qmqttconnection_p.h (1), qmqttconnectionproperties.h (4), qmqttconnectionproperties_p.h (1), qmqttcontrolpacket_p.h (1), qmqttglobal.h (1), qmqttmessage.h (2), qmqttmessage_p.h (1), qmqttpublishproperties.h (3), qmqttpublishproperties_p.h (1), qmqttsubscription.h (2), qmqttsubscription_p.h (1), qmqttsubscriptionproperties.h (3), qmqtttopicfilter.h (2), qmqtttopicname.h (2), qmqtttype.h (3) }
    QtMqtt: created version header
    QtMqtt: created master header
    QtMqtt: created headers.pri file
    Reading /Users/macbook/Desktop/qtmqtt/examples/examples.pro [/Users/macbook/Desktop/qtmqtt/build/examples]
     Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/mqtt.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt]
    Project ERROR: You cannot build examples inside the Qt source tree, except as part of a proper Qt build.
    MacBook-Pro-760:build user$  ~/Qt/5.14.2/ios/bin/qmake -r ..
    Reading /Users/macbook/Desktop/qtmqtt/src/src.pro [/Users/macbook/Desktop/qtmqtt/build/src]
     Reading /Users/macbook/Desktop/qtmqtt/src/mqtt/mqtt.pro [/Users/macbook/Desktop/qtmqtt/build/src/mqtt]
    Project MESSAGE: perl -w /Users/macbook/Qt/5.14.2/ios/bin/syncqt.pl -module QtMqtt -version 5.14.2 -outdir /Users/macbook/Desktop/qtmqtt/build -builddir /Users/macbook/Desktop/qtmqtt/build /Users/macbook/Desktop/qtmqtt
    <srcbase> = /Users/macbook/Desktop/qtmqtt 
    <bldbase> = /Users/macbook/Desktop/qtmqtt/build 
    <outbase> = /Users/macbook/Desktop/qtmqtt/build 
    Reading /Users/macbook/Desktop/qtmqtt/examples/examples.pro [/Users/macbook/Desktop/qtmqtt/build/examples]
     Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/mqtt.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/consolepubsub/consolepubsub.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/consolepubsub]
       Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/consolepubsub/qtmqtt_pub.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/consolepubsub]
       Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/consolepubsub/qtmqtt_sub.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/consolepubsub]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/simpleclient/simpleclient.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/simpleclient]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/subscriptions/subscriptions.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/subscriptions]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/quicksubscription/quicksubscription.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/quicksubscription]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/quickpublication/quickpublication.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/quickpublication]
      Reading /Users/macbook/Desktop/qtmqtt/examples/mqtt/websocketsubscription/websocketsubscription.pro [/Users/macbook/Desktop/qtmqtt/build/examples/mqtt/websocketsubscription]
    Reading /Users/macbook/Desktop/qtmqtt/tests/tests.pro [/Users/macbook/Desktop/qtmqtt/build/tests]
     Reading /Users/macbook/Desktop/qtmqtt/tests/auto/auto.pro [/Users/macbook/Desktop/qtmqtt/build/tests/auto]
     Reading /Users/macbook/Desktop/qtmqtt/tests/benchmarks/benchmarks.pro [/Users/macbook/Desktop/qtmqtt/build/tests/benchmarks]
      Reading /Users/macbook/Desktop/qtmqtt/tests/benchmarks/qmqttclient/qmqttclient.pro [/Users/macbook/Desktop/qtmqtt/build/tests/benchmarks/qmqttclient]
    

    make:

    MacBook-Pro-760:build user$ make
    cd src/ && ( test -e Makefile || /Users/macbook/Qt/5.14.2/ios/bin/qmake -o Makefile /Users/macbook/Desktop/qtmqtt/src/src.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile 
    cd mqtt/ && ( test -e Makefile || /Users/macbook/Qt/5.14.2/ios/bin/qmake -o Makefile /Users/macbook/Desktop/qtmqtt/src/mqtt/mqtt.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile 
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.Debug all
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -arch arm64 -g -fPIC -std=c++1z -fapplication-extension -arch arm64 -Xarch_arm64 -miphoneos-version-min=12.0 -Xarch_arm64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -fobjc-nonfragile-abi -fobjc-legacy-dispatch -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -fembed-bitcode-marker -Wall -Wextra -Winconsistent-missing-override -Wobjc-interface-ivars -Wobjc-method-access -Wobjc-multiple-method-names -Werror=unguarded-availability -Werror=unguarded-availability-new -Werror=unsupported-availability-guard -ffunction-sections -fdata-sections -DGLES_SILENCE_DEPRECATION -DQT_NO_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_LINKED_LIST -DQT_COMPILER_SUPPORTS_SSE2 -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_MQTT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NETWORK_LIB -DQT_CORE_LIB -I/Users/macbook/Desktop/qtmqtt/src/mqtt -I. -I/Users/macbook/Qt/5.14.2/ios/mkspecs/common/uikit -I../../include -I../../include/QtMqtt -I../../include/QtMqtt/5.14.2 -I../../include/QtMqtt/5.14.2/QtMqtt -I/Users/macbook/Qt/5.14.2/ios/include -I/Users/macbook/Qt/5.14.2/ios/include/QtNetwork -I/Users/macbook/Qt/5.14.2/ios/include/QtCore/5.14.2 -I/Users/macbook/Qt/5.14.2/ios/include/QtCore/5.14.2/QtCore -I/Users/macbook/Qt/5.14.2/ios/include/QtCore -I.moc/debug -I/Users/macbook/Qt/5.14.2/ios/mkspecs/macx-ios-clang -x c++-header -c /Users/macbook/Desktop/qtmqtt/include/QtMqtt/QtMqttDepends -o .pch/debug/Qt5Mqtt_debug_arm64.pch/c++_arm64.pch -fapplication-extension
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -arch arm64 -g -fPIC -std=c++1z -fapplication-extension -arch x86_64 -Xarch_x86_64 -mios-simulator-version-min=12.0 -Xarch_x86_64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk -fobjc-nonfragile-abi -fobjc-legacy-dispatch -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -fembed-bitcode-marker -Wall -Wextra -Winconsistent-missing-override -Wobjc-interface-ivars -Wobjc-method-access -Wobjc-multiple-method-names -Werror=unguarded-availability -Werror=unguarded-availability-new -Werror=unsupported-availability-guard -ffunction-sections -fdata-sections -DGLES_SILENCE_DEPRECATION -DQT_NO_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_LINKED_LIST -DQT_COMPILER_SUPPORTS_SSE2 -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_MQTT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NETWORK_LIB -DQT_CORE_LIB -I/Users/macbook/Desktop/qtmqtt/src/mqtt -I. -I/Users/macbook/Qt/5.14.2/ios/mkspecs/common/uikit -I../../include -I../../include/QtMqtt -I../../include/QtMqtt/5.14.2 -I../../include/QtMqtt/5.14.2/QtMqtt -I/Users/macbook/Qt/5.14.2/ios/include -I/Users/macbook/Qt/5.14.2/ios/include/QtNetwork -I/Users/macbook/Qt/5.14.2/ios/include/QtCore/5.14.2 -I/Users/macbook/Qt/5.14.2/ios/include/QtCore/5.14.2/QtCore -I/Users/macbook/Qt/5.14.2/ios/include/QtCore -I.moc/debug -I/Users/macbook/Qt/5.14.2/ios/mkspecs/macx-ios-clang -x c++-header -c /Users/macbook/Desktop/qtmqtt/include/QtMqtt/QtMqttDepends -o .pch/debug/Qt5Mqtt_debug_x86_64.pch/c++_x86_64.pch -fapplication-extension
    clang: error: cannot use 'precompiled-header' output with multiple -arch options
    make[3]: *** [.pch/debug/Qt5Mqtt_debug_x86_64.pch/c++_x86_64.pch] Error 1
    make[2]: *** [debug-all] Error 2
    make[1]: *** [sub-mqtt-make_first] Error 2
    make: *** [sub-src-make_first] Error 2
    

    I added at end of file Qt/5.15.1/ios/mkspecs/macx-ios-clang/qmake.conf QMAKE_CXXFLAGS += -arch $$QT_ARCH because without it qmake doesnt work for ios.
    This behaviour occurs in Qt 5.15.1 version also. Do You have any idea how can i get around it?


Log in to reply