Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. WebAssembly - Project ERROR: Unknown module(s) in QT: quick quickcontrols2
QtWS25 Last Chance

WebAssembly - Project ERROR: Unknown module(s) in QT: quick quickcontrols2

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
qtwebassemlbyconfigureqmakequick controls
10 Posts 3 Posters 2.5k Views
  • 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.
  • O Offline
    O Offline
    Oshio
    wrote on last edited by
    #1

    Hello I have build Qt for WebAssembly manually. Here is what I have done to setup my enviorment:

    #Goes to home folder
    cd
    
    #Download Emscripten 
    git clone https://github.com/juj/emsdk.git
    cd emsdk
    ./emsdk install sdk-fastcomp-1.38.30-64bit
    ./emsdk activate --embedded sdk-fastcomp-1.38.30-64bit
    
    #Goes to home folder
    cd
    
    #Create a folder folder for Qt stuff
    mkdir Qt
    cd Qt
    
    #Download Qt and init-repository
    git clone -b 5.14.2 https://code.qt.io/qt/qt5.git
    mv qt5 5.14.2
    cd 5.14.2
    ./init-repository -f --module-subset=qtbase,qtdeclarative,qtwebsockets,qtsvg,qtquickcontrols,qtquickcontrols2,qtgraphicaleffects,qtcharts,qtdatavis3d,qtspeech,qtgraphicaleffects
    
    #Create Shadow Build directory
    mkdir ~/5.14.2-WebAssembly
    cd ~/5.14.2-WebAssembly
    
    #Configure and Build Qt for WebAssembly
    source ~/emsdk/emsdk_env.sh
    ~/Qt/5.14.2/qtbase/configure -opensource -confirm-license -xplatform wasm-emscripten -debug -feature-thread -opensource -nomake examples -nomake tests -prefix ~/Qt/5.14.2-WebAssembly-Debug
    make -j$(nproc)
    make install -j$(nproc)
    
    #Goes to home folder
    cd
    
    # Build a test project
    git clone https://github.com/msorvig/qt-webassembly-examples.git
    cd qt-webassembly-examples/quick_controls2_gallery
    ~/Qt/5.14.2-WebAssembly-Debug/bin/qmake #ERROR 
    make #Never executed because an ERROR happens on the line above
    

    Here is the outuput of qmake:

    Project MESSAGE: Setting PTHREAD_POOL_SIZE to 4
    Project MESSAGE: Setting TOTAL_MEMORY to 1GB
    Project WARNING: This Qt was built with Emscripten version 1.38.30. You have . The difference may cause issues.
    Project ERROR: Unknown module(s) in QT: quick quickcontrols2
    

    I tried:

    sudo apt install qtquickcontrols2-5-dev
    

    But nothing changed, I still get the error.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Just use the regular Qt installer to get WASM. Much easier :-)

      This Qt was built with Emscripten version 1.38.30. You have .

      Looks like your emsdk has been lost from $PATH?

      Project ERROR: Unknown module(s) in QT: quick quickcontrols2

      No idea. Perhaps you've missed something in repo init or configure.

      (Z(:^

      1 Reply Last reply
      0
      • O Offline
        O Offline
        Oshio
        wrote on last edited by Oshio
        #3

        Thanks @sierdzio

        I did what you suggested and worked, but the binary package only supports single-thread. As you can see here in the first paragraph of "Multithreading Support". For multi-thread (what I want), building from the source seems to be the only way.

        Regarding $PATH:
        I didn't noticed, it's strange because I am executing source ~/emsdk/emsdk_env.sh before qmake. I added the em++ path to $PATH and the Warning disappeard, but the ERROR still remains.

        I read somewhere that quick controls depend on OpenGL, here is the configure output regarding OpenGL:

        OpenGL:
          Desktop OpenGL ....................... no
          OpenGL ES 2.0 ........................ yes
          OpenGL ES 3.0 ........................ no
          OpenGL ES 3.1 ........................ no
          OpenGL ES 3.2 ........................ no
        

        Do you see any source of problem? It seems that I have one version installed.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          OpenGL ES 2.0 should be enough for QtQuick controls, hmmm.

          Try to run ./configure with -v flag. It will produce a ton of output, but maybe you'll find somewhere in there a clue why it skips QtQuick.

          (also, remember to run configure from a clear location to make sure cached options are not selected)

          (Z(:^

          1 Reply Last reply
          0
          • O Offline
            O Offline
            Oshio
            wrote on last edited by
            #5

            @sierdzio I did what you suggested, and it seems there a lot of header files missing, giving lines like:

            main.cpp:5:10: fatal error: 'jpeglib.h' file not found
            

            I will spend some time trying to fix and then I will give you a return.

            Thanks for your help so far!

            1 Reply Last reply
            0
            • O Offline
              O Offline
              Oshio
              wrote on last edited by Oshio
              #6

              @sierdzio
              I found out that all libraries are installed in my system (Pop!_os 18.04), this answer in stackoverflow, let me think that it can be a linker issue.

              Below is a small piece of ./configure ... -v output regarding jpeglib.h file not found of my previous reply.
              The pattern repeats itself for many types of headers, at least it's just this type of error.

              Checking for libjpeg... 
              Trying source 0 (type pkgConfig) of library libjpeg ...
              pkg-config use disabled globally.
               => source produced no result.
              Trying source 1 (type inline) of library libjpeg ...
               => source failed condition 'config.msvc'.
              Trying source 2 (type inline) of library libjpeg ...
              + cd /home/pop_os/Qt/web-test/config.tests/libjpeg && /home/pop_os/Qt/web-test/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += libjpeg' 'QMAKE_LIBS_LIBJPEG = -ljpeg' /home/pop_os/Qt/web-test/config.tests/libjpeg
              > Project MESSAGE: Setting PTHREAD_POOL_SIZE to 4
              > Project MESSAGE: Setting TOTAL_MEMORY to 1GB
              + cd /home/pop_os/Qt/web-test/config.tests/libjpeg && MAKEFLAGS= /usr/bin/make
              > em++ -c -pipe -Os -g4 -std=gnu++11 -w -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s TOTAL_MEMORY=1GB  -I. -I/home/pop_os/.emscripten_ports/openssl/include -I/home/pop_os/Qt/5.14.2/Src/qtbase/mkspecs/wasm-emscripten -o main.o main.cpp
              > main.cpp:5:10: fatal error: 'jpeglib.h' file not found
              > #include <jpeglib.h>
              >          ^~~~~~~~~~~
              > 1 error generated.
              > shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
              > Makefile:193: recipe for target 'main.o' failed
              > make: *** [main.o] Error 1
              => source failed verification.
              test config.qtbase_gui.libraries.libjpeg FAILED
              
              jsulmJ 1 Reply Last reply
              0
              • O Oshio

                @sierdzio
                I found out that all libraries are installed in my system (Pop!_os 18.04), this answer in stackoverflow, let me think that it can be a linker issue.

                Below is a small piece of ./configure ... -v output regarding jpeglib.h file not found of my previous reply.
                The pattern repeats itself for many types of headers, at least it's just this type of error.

                Checking for libjpeg... 
                Trying source 0 (type pkgConfig) of library libjpeg ...
                pkg-config use disabled globally.
                 => source produced no result.
                Trying source 1 (type inline) of library libjpeg ...
                 => source failed condition 'config.msvc'.
                Trying source 2 (type inline) of library libjpeg ...
                + cd /home/pop_os/Qt/web-test/config.tests/libjpeg && /home/pop_os/Qt/web-test/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += libjpeg' 'QMAKE_LIBS_LIBJPEG = -ljpeg' /home/pop_os/Qt/web-test/config.tests/libjpeg
                > Project MESSAGE: Setting PTHREAD_POOL_SIZE to 4
                > Project MESSAGE: Setting TOTAL_MEMORY to 1GB
                + cd /home/pop_os/Qt/web-test/config.tests/libjpeg && MAKEFLAGS= /usr/bin/make
                > em++ -c -pipe -Os -g4 -std=gnu++11 -w -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s TOTAL_MEMORY=1GB  -I. -I/home/pop_os/.emscripten_ports/openssl/include -I/home/pop_os/Qt/5.14.2/Src/qtbase/mkspecs/wasm-emscripten -o main.o main.cpp
                > main.cpp:5:10: fatal error: 'jpeglib.h' file not found
                > #include <jpeglib.h>
                >          ^~~~~~~~~~~
                > 1 error generated.
                > shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
                > Makefile:193: recipe for target 'main.o' failed
                > make: *** [main.o] Error 1
                => source failed verification.
                test config.qtbase_gui.libraries.libjpeg FAILED
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Oshio said in WebAssembly - Project ERROR: Unknown module(s) in QT: quick quickcontrols2:

                main.cpp:5:10: fatal error: 'jpeglib.h' file not found

                This is not a linker issue. You do not have libjpeg (+ libjpeg-dev) installed for webassembly.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  Oshio
                  wrote on last edited by
                  #8

                  @jsulm
                  I've executed sudo apt install libjpeg-dev and I get:

                  libjpeg-dev is already the newest version (8c-2ubuntu8).
                  

                  This happens with every library.

                  Sorry for possibly doing a dumb question, but you wrote:

                  ... installed for webassembly.

                  There is a specific library for webassembly, so that my attempt of installing from package manager is useless?

                  jsulmJ 1 Reply Last reply
                  0
                  • O Oshio

                    @jsulm
                    I've executed sudo apt install libjpeg-dev and I get:

                    libjpeg-dev is already the newest version (8c-2ubuntu8).
                    

                    This happens with every library.

                    Sorry for possibly doing a dumb question, but you wrote:

                    ... installed for webassembly.

                    There is a specific library for webassembly, so that my attempt of installing from package manager is useless?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Oshio said in WebAssembly - Project ERROR: Unknown module(s) in QT: quick quickcontrols2:

                    sudo apt install libjpeg-dev

                    This is not for webassembly.
                    I'm not an webassembly expert, but as far as I know it is not x86, so the host libraries cannot be used. I guess you will need to compile needed libraries for webassembly first.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    O 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Oshio said in WebAssembly - Project ERROR: Unknown module(s) in QT: quick quickcontrols2:

                      sudo apt install libjpeg-dev

                      This is not for webassembly.
                      I'm not an webassembly expert, but as far as I know it is not x86, so the host libraries cannot be used. I guess you will need to compile needed libraries for webassembly first.

                      O Offline
                      O Offline
                      Oshio
                      wrote on last edited by
                      #10

                      @jsulm Uhmm now I'm starting to understand why @sierdzio told me this is not easy.
                      I will do some google search on this subject, thanks for guidance.

                      1 Reply Last reply
                      0

                      • Login

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