Problem with configuring Qt 5.12.4 for Qt for Webassembly



  • Hi Guys,
    I am trying to configure Qt for Webassembly and am currently stuck with a problem.
    I installed Emscripten and made sure that emscripten is in the Qt Path. Now i tried to configure qt as a cross compile build for emscripten-wasm but there we go i am stuck.
    Researched very much, at the beginning i wasnt even able to get anything else than my terminal saying "you have a toplevel build" when i tried to configure.

    Found something in the internet saying that i'd need a .qmake.stash and .qmake.super idk why but then that particular message dissappeared and i got a new one telling me that my em++ compiler cannot be run and additionally the JS engine cant be found.

    Tried to copy from usr/bin my node js to the node folder in emsdk but still when i configure same messages. Also thought of changing the path in the config but i dont know which config there are to many.

    I know that some people had issues which are not that different than mine but these ones didn't help me much.

    Hoping that some guys of u are familiar with that problem and can help me out here.
    Thanks a lot guys.

    Here is the configuring line: ./configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase

    Additionally the tutorials :
    https://www.qt.io/blog/2018/11/19/getting-started-qt-webassembly#contactopen

    https://emscripten.org/docs/getting_started/downloads.html

    Here is my terminal output alt text


  • Moderators

    Why do you try to compile Qt yourself? Can't you just take the prebuilt package from Qt Installer?



  • i need to compile qt for cross platform compiling so i dont think that the prebuilt version is already configured for it.
    I also think that my problem is just in the hierarchy of the folders in nautilus . Just confused.
    Reinstalled it many times and actually one thing catches my eye. Every tut is for qt 5.12.0 but i always use other versions like 5.12.4 or 3 or even 5.13.
    Thinking about going through all of the emscripten stuff again and just try it out again.
    @sierdzio Do u have any idea where the searching is taking place when i try to run configure in Qt/5.12.3/Src and my emsdk folder lays in the same dir like the Qt folder?


  • Moderators

    @kuersat said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    i need to compile qt for cross platform compiling so i dont think that the prebuilt version is already configured for it.

    The prebuilt Qt for WebAssembly is already cross-compiled. There is really no need to do it manually...

    @sierdzio Do u have any idea where the searching is taking place when i try to run configure in Qt/5.12.3/Src and my emsdk folder lays in the same dir like the Qt folder?

    What searching? It uses $PATH in normal builds, plus toolchain, sysroot when you specify the flags for cross-compilation. You can run configure with verbose flags to see more output, it might help.



  • ok i am trying to install 5.13 with the checkbox Webassembly additionally checked.
    So then my Qt is ready to cross compile for wasm -emscripten right?
    I could just set my kit up and start is that right?


  • Moderators

    @kuersat said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    ok i am trying to install 5.13 with the checkbox Webassembly additionally checked.
    So then my Qt is ready to cross compile for wasm -emscripten right?
    I could just set my kit up and start is that right?

    For me the kit does not work in Qt Creator. But I can manually build by setting emscripted SDK in $PATH and then running qmake from Qt WASM installation, then make. Then I copy & paste the output files to a web server and it works. It's all described in the documentation pretty well.



  • @sierdzio said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    @kuersat said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    ok i am trying to install 5.13 with the checkbox Webassembly additionally checked.
    So then my Qt is ready to cross compile for wasm -emscripten right?
    I could just set my kit up and start is that right?

    For me the kit does not work in Qt Creator. But I can manually build by setting emscripted SDK in $PATH and then running qmake from Qt WASM installation, then make. Then I copy & paste the output files to a web server and it works. It's all described in the documentation pretty well.

    Support for building with QtCreator is not yet been released, but will be soonish.



  • @lorn-potter thanks for information.

    @all is anybody familiar with that error?

    ERROR root: http://localhost:8000/: No such file or directory ("http://localhost:8000/" was expected to be an input file, based on the commandline arguments provided)
    Makefile:73: recipe for target 'untitled.js' failed
    make: *** [untitled.js] Error 1
    14:53:36: Der Prozess "/usr/bin/make" wurde mit dem R├╝ckgabewert 2 beendet.

    trying to do qmake in Qt which results in everything fine, after that trying to run the makefile with make and i get that problem. Idk why localhost should be an inputfile ? Cause i want to run a webserver on localhost and then with runtime support of .js file run my program in the browser.
    Thanks in advance


  • Qt Champions 2018

    @kuersat said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    is anybody familiar with that error?

    You should provide more context, at least the last command called before that error occurred.



  • the last command was make. As I mentioned I ran the Makefile. Before that i ran qmake right in Qt Creator.


  • Qt Champions 2018

    @kuersat said in Problem with configuring Qt 5.12.4 for Qt for Webassembly:

    the last command was make

    No, make calls other commands like compiler, linker and what else needs to be called to build the application.
    Can you post what is before that line

    ERROR root: http://localhost:8000/: No such file or directory ("http://localhost:8000/" was expected to be an input file, based on the commandline arguments provided)
    

    ?



  • there is nothing.
    Look, I am in Qt Creator I just "click" on "qmake". After that qmake generated a makefile which is 800 lines long so.
    In the folder I have now my .qml .pro .cpp .h and the Makefile.
    So then I switch to Terminal and just run the makefile to get the necessary file. e.g .js .wasm to run in the browser.
    But all I get is the .js the .wasm doesnt appear.
    So thats the issue.
    Of coruse i need to set the environment in the terminal active before I do this stuff. That's all I got. There is nothing special before that command. Maybe I dont get what you want



  • hey guys this problem has been solved by installing qt 5.13 with Installer.
    Additionally just clone emsdk from git and follow instructions in qt documentation.
    Now I can compile and run in Browser.
    But still its a bit problematic with qt cause you just cant run from qt. Hope that the release comes soon to build directly from Qt

    I wanted to ask you guys a question in relation to qt configuring kits. The webassembly kit it could not find any ABI and that qml scene is not installed. Its a warning but I can still do qmake and make and run the project in the browser.


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.