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

HelloWorld Wasm build problem



  • I am trying to build a super simple project on Windows, but I get errors. I tried everything, but the error seems so vague.

    10:34:00: Running steps for project hello...
    10:34:00: Starting: "C:\Qt\5.15.0\wasm_32\bin\qmake.exe" C:\hello\hello.pro -spec wasm-emscripten "CONFIG+=debug" "CONFIG+=qml_debug"
    Info: creating stash file C:\hello\build-hello-Qt_5_15_0_WebAssembly-Debug\.qmake.stash
    10:34:02: The process "C:\Qt\5.15.0\wasm_32\bin\qmake.exe" exited normally.
    10:34:02: Starting: "C:\ProgramData\chocolatey\bin\mingw32-make.exe" -f C:/hello/build-hello-Qt_5_15_0_WebAssembly-Debug/Makefile qmake_all
    mingw32-make: Nothing to be done for 'qmake_all'.
    10:34:02: The process "C:\ProgramData\chocolatey\bin\mingw32-make.exe" exited normally.
    10:34:02: Starting: "C:\ProgramData\chocolatey\bin\mingw32-make.exe" -j8
    em++ -c -g -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\hello -I. -IC:\Qt\5.15.0\wasm_32\include -IC:\Qt\5.15.0\wasm_32\include\QtQuick -IC:\Qt\5.15.0\wasm_32\include\QtGui -IC:\Qt\5.15.0\wasm_32\include\QtQmlModels -IC:\Qt\5.15.0\wasm_32\include\QtQml -IC:\Qt\5.15.0\wasm_32\include\QtNetwork -IC:\Qt\5.15.0\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.0\wasm_32\mkspecs\wasm-emscripten -o main.obj ..\hello\main.cpp
    em++ -c -g -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\hello -I. -IC:\Qt\5.15.0\wasm_32\include -IC:\Qt\5.15.0\wasm_32\include\QtQuick -IC:\Qt\5.15.0\wasm_32\include\QtGui -IC:\Qt\5.15.0\wasm_32\include\QtQmlModels -IC:\Qt\5.15.0\wasm_32\include\QtQml -IC:\Qt\5.15.0\wasm_32\include\QtNetwork -IC:\Qt\5.15.0\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.0\wasm_32\mkspecs\wasm-emscripten -o hello.js_plugin_import.obj C:/hello/build-hello-Qt_5_15_0_WebAssembly-Debug/hello.js_plugin_import.cpp
    em++ -c -g -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\hello -I. -IC:\Qt\5.15.0\wasm_32\include -IC:\Qt\5.15.0\wasm_32\include\QtQuick -IC:\Qt\5.15.0\wasm_32\include\QtGui -IC:\Qt\5.15.0\wasm_32\include\QtQmlModels -IC:\Qt\5.15.0\wasm_32\include\QtQml -IC:\Qt\5.15.0\wasm_32\include\QtNetwork -IC:\Qt\5.15.0\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.0\wasm_32\mkspecs\wasm-emscripten -o hello.js_qml_plugin_import.obj C:/hello/build-hello-Qt_5_15_0_WebAssembly-Debug/hello.js_qml_plugin_import.cpp
    C:\Qt\5.15.0\wasm_32\bin\rcc.exe -name qml ..\hello\qml.qrc -o qrc_qml.cpp
    C:\Qt\5.15.0\wasm_32\bin\qmake.exe -install sed -e s/@APPNAME@/hello/g C:/Qt/5.15.0/wasm_32/plugins/platforms/wasm_shell.html > C:/hello/build-hello-Qt_5_15_0_WebAssembly-Debug/hello.html
    copy /y C:\Qt\5.15.0\wasm_32\plugins\platforms\qtloader.js C:\hello\build-hello-Qt_5_15_0_WebAssembly-Debug
    copy /y C:\Qt\5.15.0\wasm_32\plugins\platforms\qtlogo.svg C:\hello\build-hello-Qt_5_15_0_WebAssembly-Debug
    The syntax of the command is incorrect.
    mingw32-make: *** [Makefile:420: appjs] Error 1
    mingw32-make: *** Waiting for unfinished jobs....
    The syntax of the command is incorrect.
    mingw32-make: *** [Makefile:423: appsvg] Error 1
    10:34:09: The process "C:\ProgramData\chocolatey\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project hello (kit: Qt 5.15.0 WebAssembly)
    When executing step "Make"
    10:34:09: Elapsed time: 00:09.
    

    The code is just a Qt Quick application empty template

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    }
    

    This is how I installed emsdk

    git clone https://github.com/emscripten-core/emsdk.git
    cd emsdk
    git pull
    ./emsdk update-tags
    ./emsdk install sdk-fastcomp-1.39.7-64bit
    ./emsdk activate sdk-fastcomp-1.39.7-64bit --global
     ./emsdk_env.bat
    
    # manually add ENVs 
    $Env:EMSDK_NODE="C:\emsdk\node\12.9.1_64bit\bin\node.exe"
    $Env:JAVA_HOME="C:\emsdk\java\8.152_64bit"
    $Env:EMSDK_PYTHON="C:\Python38"
    $Env:PATH+=";C:\emsdk;C:\emsdk\node\12.9.1_64bit\bin;C:\emsdk\java\8.152_64bit\bin;C:\emsdk\fastcomp\emscripten;"
    

    These are my configurations:
    2020-05-03 10_33_13-Qt Creator.jpg
    2020-05-03 10_33_27-Options - Qt Creator.jpg
    2020-05-03 10_33_36-Options - Qt Creator.jpg



  • I solved the problem, and the error is gone now. I had named one of my folders in the path C++ which caused all of these issues.

    This was mentioned by one of the people in the Slack group:

    The following error message (and the fact that you get two of them) suggests a problem with the copy command, For example, spaces in the paths which are not properly escaped or quoted.

    The syntax of the command is incorrect.
    


  • 5.15 binaries do not use fastcomp version.
    I usually do
    emsdk install 1.39.8



  • @lorn-potter

    I tried the version you said, but it doesn't work. I get the same error:

    22:01:26: Running steps for project hello...
    22:01:26: Configuration unchanged, skipping qmake step.
    22:01:26: Starting: "C:\ProgramData\chocolatey\bin\mingw32-make.exe" -j8
    em++ -c -g -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\hello -I. -IC:\Qt\5.15.0\wasm_32\include -IC:\Qt\5.15.0\wasm_32\include\QtQuick -IC:\Qt\5.15.0\wasm_32\include\QtGui -IC:\Qt\5.15.0\wasm_32\include\QtQmlModels -IC:\Qt\5.15.0\wasm_32\include\QtQml -IC:\Qt\5.15.0\wasm_32\include\QtNetwork -IC:\Qt\5.15.0\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.0\wasm_32\mkspecs\wasm-emscripten -o qrc_qml.obj qrc_qml.cpp
    C:\Qt\5.15.0\wasm_32\bin\qmake.exe -install sed -e s/@APPNAME@/hello/g C:/Qt/5.15.0/wasm_32/plugins/platforms/wasm_shell.html > C:/hello/build-hello-Qt_5_15_0_WebAssembly-Debug/hello.html
    copy /y C:\Qt\5.15.0\wasm_32\plugins\platforms\qtloader.js C:\hello\build-hello-Qt_5_15_0_WebAssembly-Debug
    copy /y C:\Qt\5.15.0\wasm_32\plugins\platforms\qtlogo.svg C:\hello\build-hello-Qt_5_15_0_WebAssembly-Debug
    The syntax of the command is incorrect.
    mingw32-make: *** [Makefile:420: appjs] Error 1
    mingw32-make: *** Waiting for unfinished jobs....
    The syntax of the command is incorrect.
    mingw32-make: *** [Makefile:423: appsvg] Error 1
    22:01:31: The process "C:\ProgramData\chocolatey\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project hello (kit: Qt 5.15.0 WebAssembly)
    When executing step "Make"
    22:01:31: Elapsed time: 00:05.
    

    I wish the Qt installer had an option for installing a working version of the compiler.



  • Trying on Qt 14.2, the errors are worse (using the same emsdk):

    In file included from C:\Qt\5.14.2\wasm_32\include\QtCore/qjsonobject.h:43:
    C:\Qt\5.14.2\wasm_32\include\QtCore/qjsonvalue.h:186:20: warning: definition of implicit copy constructor for 'QJsonValueRef' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
        QJsonValueRef &operator = (const QJsonValueRef &val);
                       ^
    C:\Qt\5.14.2\wasm_32\include\QtCore/qjsonobject.h:150:53: note: in implicit copy constructor for 'QJsonValueRef' first required here
            inline QJsonValueRef value() const { return QJsonValueRef(o, i); }
                                                        ^
    3 warnings generated.
    3 warnings generated.
    2 warnings generated.
    23:03:10: The process "C:\ProgramData\chocolatey\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project demo2 (kit: Qt 5.14.2 WebAssembly)
    When executing step "Make"
    23:03:10: Elapsed time: 00:09.
    


  • Do you have sed installed?

    https://wiki.qt.io/Qt_for_WebAssembly



  • What version of mingw32 are you using? You can use the mingw32 that is in the Qt directory.



  • I solved the problem, and the error is gone now. I had named one of my folders in the path C++ which caused all of these issues.

    This was mentioned by one of the people in the Slack group:

    The following error message (and the fact that you get two of them) suggests a problem with the copy command, For example, spaces in the paths which are not properly escaped or quoted.

    The syntax of the command is incorrect.
    


  • @Amin-Ya Would you please specify what exactly you are referring to when you are saying the C++ path? I seem to be having the same problem here.


Log in to reply