Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Unable to run an example using MQTT
Forum Updated to NodeBB v4.3 + New Features

Unable to run an example using MQTT

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
5 Posts 2 Posters 754 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nsourl
    wrote on 18 Sept 2020, 07:41 last edited by
    #1

    Hi,

    I am having an issue to run a simple QT WebAssembly example with Qt MQTT because I receive the below compilation error:

    Project ERROR: Unknown module(s) in QT: mqtt

    Qt version: 5.15.0

    emscripten version: 1.39.8

    Depending on Qt official documentation the MQTT module is supported but I can not verify it in my case.

    https://wiki.qt.io/Qt_for_WebAssembly#Supported_Qt_Modules

    Any suggestions or ideas why I am having this compilation error ?

    Note: I am able to run normally other WebAssembly examples without using QT MQTT module.

    Thanks.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JKSH
      Moderators
      wrote on 18 Sept 2020, 14:04 last edited by
      #2

      Hi @nsourl, and welcome!

      You probably have to build the Qt MQTT libraries first. Download the source code from https://code.qt.io/cgit/qt/qtmqtt.git/tree/ and build it for WebAssembly.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2
      • N Offline
        N Offline
        nsourl
        wrote on 19 Sept 2020, 14:31 last edited by
        #3

        Hi @JKSH ,

        Thank you for your reply!

        But I have already downloaded the Qt MQTT source code during Qt 5.15.0 installation and I am running normally the MQTT app using g++ on my 64-bit desktop computer. So, this is not enough and I have to build the source code of Qt MQTT explicitly for WebAssembly?

        Thanks.

        J 1 Reply Last reply 20 Sept 2020, 01:12
        0
        • N nsourl
          19 Sept 2020, 14:31

          Hi @JKSH ,

          Thank you for your reply!

          But I have already downloaded the Qt MQTT source code during Qt 5.15.0 installation and I am running normally the MQTT app using g++ on my 64-bit desktop computer. So, this is not enough and I have to build the source code of Qt MQTT explicitly for WebAssembly?

          Thanks.

          J Offline
          J Offline
          JKSH
          Moderators
          wrote on 20 Sept 2020, 01:12 last edited by
          #4

          @nsourl said in Unable to run an example using MQTT:

          I have already downloaded the Qt MQTT source code during Qt 5.15.0 installation and I am running normally the MQTT app using g++ on my 64-bit desktop computer.

          OK, you have the Qt MQTT libraries built for x86_64 applications.

          You also need the Qt MQTT libraries built for WebAssembly applications.

          So, this is not enough and I have to build the source code of Qt MQTT explicitly for WebAssembly?

          Correct. x86_64 and WebAssembly are completely different and incompatible platforms.

          Think of it this way: 64-bit Windows desktop libraries can only be used with 64-bit Windows desktop applications. They cannot be used in:

          • 32-bit Windows desktop applications
          • 64-bit Linux applications
          • 64-bit macOS applications
          • WebAssembly applications
          • Android applications
          • iOS applications

          For each platform above that you want to support, you need to download or build a dedicated set of libraries.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          2
          • N Offline
            N Offline
            nsourl
            wrote on 21 Sept 2020, 09:56 last edited by
            #5

            Hi @JKSH ,

            Now it's clear enough what I have to do, then I will try to build the source code for Qt WebAssembly and generate the necessary set of libraries.

            I appreciate your help on this!

            Thanks.

            1 Reply Last reply
            0

            1/5

            18 Sept 2020, 07:41

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved