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. Trouble getting started with WebAssembly + QtWidgets (c++, Windows)
Forum Updated to NodeBB v4.3 + New Features

Trouble getting started with WebAssembly + QtWidgets (c++, Windows)

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 405 Views 1 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.
  • T Offline
    T Offline
    Tom Sirgedas
    wrote on 17 Feb 2023, 21:41 last edited by
    #1

    I create desktop QtWidget apps, but I'm interested in putting my work on the web.

    I'm not too familiar with command-line building, so I might be making an obvious mistake.

    For now I'm just trying to build a bare-bones CPP and failing. Should I be using cmake instead?

    C:\Git\wasm_test>C:\Git\emsdk\emsdk_env.bat
    Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1)
    Adding directories to PATH:
    PATH += C:\Git\emsdk
    PATH += C:\Git\emsdk\upstream\emscripten
    PATH += C:\Git\emsdk\node\14.18.2_64bit\bin
    
    Setting environment variables:
    PATH = C:\Git\emsdk;C:\Git\emsdk\upstream\emscripten;C:\Git\emsdk\node\14.18.2_64bit\bin;  (...)
    EMSDK = C:/Git/emsdk
    EMSDK_NODE = C:\Git\emsdk\node\14.18.2_64bit\bin\node.exe
    EMSDK_PYTHON = C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe
    JAVA_HOME = C:\Git\emsdk\java\8.152_64bit
    Clearing existing environment variable: EMSDK_PY
    
    C:\Git\wasm_test>D:\Qt6\6.4.2\wasm_32\bin\qmake -o Makefile hello4.pro
    Project MESSAGE: Setting INITIAL_MEMORY to 50MB
    
    C:\Git\wasm_test>emmake make
    make: make
    em++ -c -O2 -std=gnu++1z -Wall -Wextra -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -ID:/Qt6/6.4.2/wasm_32/include -ID:/Qt6/6.4.2/wasm_32/include/QtGui -ID:/Qt6/6.4.2/wasm_32/include/QtCore -I. -I/.emscripten_ports/openssl/include -ID:/Qt6/6.4.2/wasm_32/mkspecs/wasm-emscripten -o hello4.obj hello4.cpp
    /cygdrive/c/Git/emsdk/upstream/emscripten/em++: line 36: exec: C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe: not found
    make: *** [Makefile:655: hello4.obj] Error 127
    emmake: error: 'make' failed (returned 2)
    

    The error is weird, because python.exe exists at that path:

    C:\Git\wasm_test>C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe
    Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
    1 Reply Last reply
    0
    • L Offline
      L Offline
      lorn.potter
      wrote on 18 Feb 2023, 05:32 last edited by
      #2

      You need to install ninja and use that to build.
      MSVC compiler and Emscripten don't mix well.

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      0

      1/2

      17 Feb 2023, 21:41

      • Login

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