Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110399

Qt 5.15.8 WinRT build issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15.9
    • 5.15.8
    • Build System
    • None
    • Windows 10 Version 22H2
      Visual Studio 2019
    • Windows, WinRT
    • d8473c74e16e2e1d99b97894616ca9a0cd0662c9

    Description

      Hello!

      I want to build Qt 5.15.8 for WinRT. I use the following command: C:\QtBuild\qt-everywhere-src-5.15.8\qtbase\configure.bat -top-level -debug -xplatform "winrt-x86-msvc2019" -confirm-license -mp -opensource -nomake examples -no-ltcg -skip qtwebengine -prefix "C:\Qt\5.15.8\winrt_x86_msvc2019"

      CMD output:

      Running configuration tests...
      Checking for valid makespec... yes
      Checking for target architecture... i386
      Checking for host architecture... i386
      Checking for SSE2 instructions... yes
      Checking for AES new instructions... yes
      Checking for alloca() in alloca.h... no
      Checking for alloca() in malloc.h... yes
      Checking for SSE3 instructions... yes
      Checking for SSSE3 instructions... yes
      Checking for SSE4.1 instructions... yes
      Checking for SSE4.2 instructions... yes
      Checking for AVX instructions... yes
      Checking for AVX2 instructions... yes
      Checking for AVX512 F instructions... yes
      Checking for AVX512 BW instructions... yes
      Checking for AVX512 CD instructions... yes
      Checking for AVX512 DQ instructions... yes
      Checking for AVX512 ER instructions... yes
      Checking for AVX512 IFMA instructions... yes
      Checking for AVX512 PF instructions... yes
      Checking for AVX512 VBMI instructions... yes
      Checking for AVX512 VL instructions... yes
      Checking for C++14 support... yes
      Checking for C++17 support... yes
      Checking for C99 support... no
      Checking for F16C instructions... yes
      Checking for D-Bus >= 1.2 (host)... yes
      Checking for IncrediBuild... no
      Checking for Support for Intel Control-flow Enforcement Technology... no
      Checking for udev... no
      Checking for POSIX fallocate()... no
      Checking for precompiled header support... yes
      Checking for RDRAND instruction... yes
      Checking for RDSEED instruction... yes
      Checking for SHA new instructions... yes
      Checking for Signaling NaN for doubles... yes
      Checking for STL compatibility... yes
      Checking for zlib... no
      Checking for Intrinsics without -mXXX argument... yes
      Checking for Zstandard... no
      Checking for C++11 <future>... no
      Checking for eventfd... no
      Checking for inotify... no
      Checking for PCRE2... no
      Checking for slog2... no
      Checking for 64 bit atomics... yes
      Checking for DoubleConversion... no
      Checking for O_CLOEXEC... no
      Checking for advapi32... yes
      Checking for gdi32... yes
      Checking for kernel32... yes
      Checking for netapi32... yes
      Checking for ole32... yes
      Checking for shell32... yes
      Checking for uuid... yes
      Checking for user32... yes
      Checking for winmm... yes
      Checking for ws2_32... yes
      Checking for C++11 <random>... yes
      Checking for working std::atomic for function pointers... yes
      Checking for getifaddrs()... no
      Checking for IPv6 ifname... no
      Checking for Network List Manager... no
      Checking for XCB >= 1.11... no
      Checking for DirectX GUID... yes
      Checking for Direct3D Shader Compiler... C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x86/fxc.exe
      Checking for DirectX GI... yes
      Checking for Direct3D 11... yes
      Checking for Direct3D Shader Compiler Library... yes
      Checking for D3D11_QUERY_DATA_TIMESTAMP_DISJOINT... yes
      Checking for DirectX GI 1.2... yes
      Checking for Direct3D 11.1... yes
      Checking for DirectWrite... yes
      Checking for DirectWrite 1... yes
      Checking for DirectWrite 2... yes
      Checking for KMS... no
      Checking for EGL... no
      Checking for evdev... no
      Checking for GBM... no
      Checking for LinuxFB... no
      Checking for mtdev... no
      Checking for OpenVG... no
      Checking for default QPA platform... winrt
      Checking for libjpeg... no
      Checking for libmd4c... no
      Checking for tslib... no
      Checking for Vulkan... no
      Checking for XLib... no
      Checking for xkbcommon >= 0.5.0... no
      Checking for CUPS... no
      Checking for DB2 (IBM)... no
      Checking for InterBase... no
      Checking for MySQL... no
      Checking for OCI (Oracle)... no
      Checking for ODBC... no
      Checking for PostgreSQL... no
      Checking for SQLite (version 2)... no
      Checking for TDS (Sybase)... no
      Checking for 32bit pointers... yes
      Checking for python... C:\Python27\python.exe
      Checking for Direct3D 12... yes
      Checking for Assimp... no
      Checking for SDL2... no
      Checking for Assimp... no
      Checking for Autodesk FBX... no
      Checking for Wayland EGL library... no
      Checking for BlueZ... no
      Checking for WinRT Bluetooth API... yes
      Checking for WinRT extended bluetooth low energy API... yes
      Checking for sensorfw... no
      Checking for Gypsy... no
      Checking for WinRT Geolocation API... yes
      Checking for DirectShow... yes
      Checking for evr.h... yes
      Checking for Vivante GPU... no
      Checking for GStreamer 1.0... no
      Checking for GStreamer 0.10... no
      Checking for OpenAL... no
      Checking for libresourceqt5... no
      Checking for Windows Audio Services... no
      Checking for WMF... yes
      Checking for wmsdk.h... yes
      Checking for WShellItem... no
      Checking for Flite... no
      Checking for libclang... yes
      Done running configuration tests.
      
      Configure summary:
      
      Building on: win32-msvc (i386, CPU features: sse sse2)
      Building for: winrt-x86-msvc2019 (i386, CPU features: sse sse2)
      Target compiler: msvc 192930147
      Configuration: cross_compile sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples f16c msvc_mp precompile_header rdrnd rdseed shani x86SimdAlways shared shared debug c++11 c++14 c++17 c++1z concurrent no-pkg-config release_tools stl
      Build options:
        Mode ................................... debug; optimized tools
        Building shared libraries .............. yes
        Using C standard ....................... C89
        Using C++ standard ..................... C++17
        Relocatable ............................ yes
        Using precompiled headers .............. yes
        Using LTCG ............................. no
        Target compiler supports:
          SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
          AVX .................................. AVX AVX2
          AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
          Other x86 ............................ AES F16C RDRAND SHA
        Build parts ............................ libs
        App store compliance ................... yes
      Qt modules and options:
        Qt Concurrent .......................... yes
        Qt D-Bus ............................... no
        Qt D-Bus directly linked to libdbus .... no
        Qt Gui ................................. yes
        Qt Network ............................. yes
        Qt Sql ................................. yes
        Qt Testlib ............................. yes
        Qt Widgets ............................. yes
        Qt Xml ................................. yes
      Support enabled for:
        Using pkg-config ....................... no
        udev ................................... no
        Using system zlib ...................... no
        Zstandard support ...................... no
      Qt Core:
        DoubleConversion ....................... yes
          Using system DoubleConversion ........ no
        GLib ................................... no
        iconv .................................. no
        ICU .................................... no
        Built-in copy of the MIME database ..... yes
        Tracing backend ........................ <none>
        Logging backends:
          journald ............................. no
          syslog ............................... no
          slog2 ................................ no
        PCRE2 .................................. yes
          Using system PCRE2 ................... no
      Qt Network:
        getifaddrs() ........................... no
        IPv6 ifname ............................ no
        libproxy ............................... no
        OpenSSL ................................ no
          Qt directly linked to OpenSSL ........ no
        OpenSSL 1.1 ............................ no
        DTLS ................................... no
        OCSP-stapling .......................... no
        SCTP ................................... no
        Use system proxies ..................... yes
        GSSAPI ................................. no
      Qt Gui:
        Accessibility .......................... yes
        FreeType ............................... yes
          Using system FreeType ................ no
        HarfBuzz ............................... yes
          Using system HarfBuzz ................ no
        Fontconfig ............................. no
        Image formats:
          GIF .................................. yes
          ICO .................................. yes
          JPEG ................................. yes
            Using system libjpeg ............... no
          PNG .................................. yes
            Using system libpng ................ no
        Text formats:
          HtmlParser ........................... yes
          CssParser ............................ yes
          OdfWriter ............................ yes
          MarkdownReader ....................... yes
            Using system libmd4c ............... no
          MarkdownWriter ....................... yes
        EGL .................................... yes
        OpenVG ................................. no
        OpenGL:
          ANGLE ................................ yes
          Combined ANGLE Library ............... no
          Desktop OpenGL ....................... no
          Dynamic OpenGL ....................... no
          OpenGL ES 2.0 ........................ yes
          OpenGL ES 3.0 ........................ no
          OpenGL ES 3.1 ........................ no
          OpenGL ES 3.2 ........................ no
        Vulkan ................................. no
        Session Management ..................... yes
      Features used by QPA backends:
        evdev .................................. no
        libinput ............................... no
        INTEGRITY HID .......................... no
        mtdev .................................. no
        tslib .................................. no
        xkbcommon .............................. no
        X11 specific:
          XLib ................................. no
          XCB Xlib ............................. no
          EGL on X11 ........................... no
          xkbcommon-x11 ........................ no
      QPA backends:
        DirectFB ............................... no
        EGLFS .................................. no
        LinuxFB ................................ no
        VNC .................................... no
        Windows:
          Direct 2D ............................ no
          DirectWrite .......................... yes
          DirectWrite 2 ........................ yes
      Qt Sql:
        SQL item models ........................ yes
      Qt Widgets:
        GTK+ ................................... no
        Styles ................................. Fusion Windows
      Qt PrintSupport:
        CUPS ................................... no
      Qt Sql Drivers:
        DB2 (IBM) .............................. no
        InterBase .............................. no
        MySql .................................. no
        OCI (Oracle) ........................... no
        ODBC ................................... no
        PostgreSQL ............................. no
        SQLite2 ................................ no
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      Qt Testlib:
        Tester for item models ................. yes
      Qt SerialBus:
        Socket CAN ............................. no
        Socket CAN FD .......................... no
        SerialPort Support ..................... no
      Further Image Formats:
        JasPer ................................. no
        MNG .................................... no
        TIFF ................................... no
          Using system libtiff ................. no
        WEBP ................................... yes
          Using system libwebp ................. no
      Qt QML:
        QML network support .................... yes
        QML debugging and profiling support .... yes
        QML just-in-time compiler .............. yes
        QML sequence object .................... yes
        QML XML http request ................... yes
        QML Locale ............................. yes
      Qt QML Models:
        QML list model ......................... yes
        QML delegate model ..................... yes
      Qt Quick:
        Direct3D 12 ............................ yes
        AnimatedImage item ..................... yes
        Canvas item ............................ yes
        Support for Qt Quick Designer .......... yes
        Flipable item .......................... yes
        GridView item .......................... yes
        ListView item .......................... yes
        TableView item ......................... yes
        Path support ........................... yes
        PathView item .......................... yes
        Positioner items ....................... yes
        Repeater item .......................... yes
        ShaderEffect item ...................... yes
        Sprite item ............................ yes
      QtQuick3D:
        Assimp ................................. yes
        System Assimp .......................... no
      Qt Scxml:
        ECMAScript data model for QtScxml ...... yes
      Qt Gamepad:
        SDL2 ................................... no
      Qt 3D:
        Assimp ................................. yes
        System Assimp .......................... no
        Output Qt3D GL traces .................. no
        Use SSE2 instructions .................. no
        Use AVX2 instructions .................. no
        Aspects:
          Render aspect ........................ yes
          Input aspect ......................... yes
          Logic aspect ......................... yes
          Animation aspect ..................... yes
          Extras aspect ........................ yes
      Qt 3D Renderers:
        OpenGL Renderer ........................ yes
        RHI Renderer ........................... no
      Qt 3D GeometryLoaders:
        Autodesk FBX ........................... no
      Qt Wayland Client ........................ no
      Qt Wayland Compositor .................... no
      Qt Bluetooth:
        BlueZ .................................. no
        BlueZ Low Energy ....................... no
        Linux Crypto API ....................... no
        Native Win32 Bluetooth ................. no
        WinRT Bluetooth API (desktop & UWP) .... yes
        WinRT advanced bluetooth low energy API (desktop & UWP) . yes
      Qt Sensors:
        sensorfw ............................... no
      Qt Quick Controls 2:
        Styles ................................. Default Fusion Imagine Material Universal
      Qt Quick Templates 2:
        Hover support .......................... yes
        Multi-touch support .................... yes
      Qt Positioning:
        Gypsy GPS Daemon ....................... no
        WinRT Geolocation API .................. yes
      Qt Location:
        Qt.labs.location experimental QML plugin . no
        Geoservice plugins:
          OpenStreetMap ........................ yes
          HERE ................................. yes
          Esri ................................. yes
          Mapbox ............................... yes
          MapboxGL ............................. no
          Itemsoverlay ......................... yes
      QtXmlPatterns:
        XML schema support ..................... yes
      Qt Multimedia:
        ALSA ................................... no
        GStreamer 1.0 .......................... no
        GStreamer 0.10 ......................... no
        Video for Linux ........................ no
        OpenAL ................................. no
        PulseAudio ............................. no
        Resource Policy (libresourceqt5) ....... no
        Windows Audio Services ................. no
        DirectShow ............................. yes
        Windows Media Foundation ............... yes
      Qt TextToSpeech:
        Flite .................................. no
        Flite with ALSA ........................ no
        Speech Dispatcher ...................... no
      Qt Tools:
        Qt Assistant ........................... yes
        Qt Designer ............................ yes
        Qt Distance Field Generator ............ yes
        kmap2qmap .............................. yes
        Qt Linguist ............................ yes
        Mac Deployment Tool .................... no
        makeqpf ................................ yes
        pixeltool .............................. yes
        qdbus .................................. yes
        qev .................................... yes
        Qt Attributions Scanner ................ yes
        qtdiag ................................. yes
        qtpaths ................................ yes
        qtplugininfo ........................... yes
        Windows deployment tool ................ yes
        WinRT Runner Tool ...................... yes
      Qt Tools:
        QDoc ................................... yes
      
      Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
      
      Note: The following modules are not being compiled in this configuration:
          serialport
      
      Qt is now configured for building. Just run 'jom'.
      Once everything is built, you must run 'jom install'.
      Qt will be installed into 'C:\Qt\5.15.8\winrt_x86_msvc2019'.
      
      Prior to reconfiguration, make sure you remove any leftovers from
      the previous build.
      
      C:\QtBuild\qt-everywhere-src-5.15.8\qtBuild>
      

      The problem is with qlowenergycontroller_winrt_new.cpp file - 439 line.

      qbluetoothsocket_winrt.cpp
      qbluetoothutils_winrt.cpp
      qlowenergycontroller_winrt.cpp
      qlowenergycontroller_winrt_new.cpp
      C:\QtBuild\qt-everywhere-src-5.15.8\qtconnectivity\src\bluetooth\qlowenergycontroller_winrt_new.cpp(439): error C3861: 'CoInitialize': identifier not found
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.EXE"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.

      qlowenergycontroller_winrt_new.cpp

      void QWinRTLowEnergyConnectionHandler::connectToDevice()
      {
      qCDebug(QT_BT_WINRT) << _FUNCTION_;
      mInitialized = CoInitialize(NULL); //439 line which leads to this error
      qCDebug(QT_BT_WINRT) << qt_error_string(mInitialized);
      auto earlyExit = [this]()
      { return mAbortConnection; }
      ;
      ComPtr<IBluetoothLEDeviceStatics> deviceStatics;
      HRESULT hr = GetActivationFactory(
      HString::MakeReference(RuntimeClass_Windows_Devices_Bluetooth_BluetoothLEDevice).Get(),
      &deviceStatics);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not obtain device factory");
      ComPtr<IAsyncOperation<BluetoothLEDevice *>> deviceFromIdOperation;
      hr = deviceStatics->FromBluetoothAddressAsync(mAddress.toUInt64(), &deviceFromIdOperation);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not find LE device from address");
      hr = QWinRTFunctions::await(deviceFromIdOperation, mDevice.GetAddressOf(),
      QWinRTFunctions::ProcessMainThreadEvents, 5000, earlyExit);
      if (FAILED(hr) || !mDevice)
      { emitErrorAndQuitThread("Could not find LE device"); return; }
      // get GattSession: 1. get device id
      ComPtr<IBluetoothLEDevice4> device4;
      hr = mDevice.As(&device4);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not cast device");
      ComPtr<IBluetoothDeviceId> deviceId;
      hr = device4->get_BluetoothDeviceId(&deviceId);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not get bluetooth device id");
      // get GattSession: 2. get session statics
      ComPtr<IGattSessionStatics> sessionStatics;
      hr = GetActivationFactory(
      HString::MakeReference(
      RuntimeClass_Windows_Devices_Bluetooth_GenericAttributeProfile_GattSession)
      .Get(),
      &sessionStatics);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not obtain GattSession statics");
      // get GattSession: 3. get session
      ComPtr<IAsyncOperation<GattSession *>> gattSessionFromIdOperation;
      hr = sessionStatics->FromDeviceIdAsync(deviceId.Get(), &gattSessionFromIdOperation);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not get GattSession from id");
      hr = QWinRTFunctions::await(gattSessionFromIdOperation, mGattSession.GetAddressOf(),
      QWinRTFunctions::ProcessMainThreadEvents, 5000, earlyExit);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not complete Gatt session acquire");
      BluetoothConnectionStatus status;
      hr = mDevice->get_ConnectionStatus(&status);
      EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not obtain device's connection status");
      if (status == BluetoothConnectionStatus::BluetoothConnectionStatus_Connected)
      { emitConnectedAndQuitThread(); return; }
      QBluetoothLocalDevice localDevice;
      QBluetoothLocalDevice::Pairing pairing = localDevice.pairingStatus(mAddress);
      if (pairing == QBluetoothLocalDevice::Unpaired)
      connectToUnpairedDevice();
      else
      connectToPairedDevice();
      }
      

      I have tried to add #include <objbase.h> to qlowenergycontroller_winrt_new.cpp but it still leads to this error. Any ideas how to fix it? Thank you.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            cobra91151 Ruslan Sydorvych
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes