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. Error while parsing file Test.pro. Giving up

Error while parsing file Test.pro. Giving up

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 1 Posters 447 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.
  • C Offline
    C Offline
    cancech
    wrote on last edited by
    #1

    I'm trying to dip my toes into Qt WebAssembly in Windows 10, so I performed the necessary setup as per the Qt for WebAssembly instructions. With that I now have the following installed:

    • Qt: 6.5.2
    • Qt Creator: 11.0
    • emsdk: 3.1.25

    In Qt Creator Preferences > Devices > WebAssembly I see the following:

    Adding directories to PATH:
    
    C:\dev\emsdk-3.1.44\node\16.20.0_64bit\bin
    C:\dev\emsdk-3.1.44\upstream\emscripten
    C:\dev\emsdk-3.1.44
    C:\dev\emsdk-3.1.44\python\3.9.2-nuget_64bit
    
    Setting environment variables:
    
    EMSDK=C:/dev/emsdk-3.1.44
    EMSDK_NODE=C:\dev\emsdk-3.1.44\node\16.20.0_64bit\bin\node.exe
    EMSDK_PYTHON=C:\dev\emsdk-3.1.44\python\3.9.2-nuget_64bit\python.exe
    JAVA_HOME=C:\dev\emsdk-3.1.44\java\8.152_64bit
    

    which looks like it should be OK from what I can see (note: I downloaded the latest emsdk release from GitHub and used it to install 3.1.25), and it is showing the activated version as 3.1.25.

    Going into Preferences > Kits > Kits I can see the C and C++ compiler for WebAssembly Qt 6.5.2 (multi-threaded) is Emscripten Compiler 3.1.25 for C/C++ which also looks to be correct based on everything I've managed to surmise.

    At this point I create a new Qt Widgets Application project called Test and tell it to use the Desktop Qt 6.5.2 MinGW 64-bit and WebAssembly Qt 6.5.2 (multi-threaded) kits. Without making changes to what is generated by Qt Creator I can launch the project as a Desktop application and see the empty window appear on screen. However when I switch to WebAssembly I am greeted by an error

    <path>\Test\Test.pro:-1: error: Error while parsing file <path>\Test\Test.pro. Giving up.
    

    The project only lists the Test.pro file and nothing else (when in desktop I can see all h, cpp, and ui files). If I try to compile the project all I get is the following error:

    Error while building/deploying project Test (kit: WebAssembly Qt 6.5.2 (multi-threaded))
    When executing step "Make"
    

    I haven't touched any of the generated files (h, cpp, ui, pro), and am very much as a loss as to what's going on. My Test.pro is as follows:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++17
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      cancech
      wrote on last edited by
      #2

      Finally getting around to digging some more into this, and it seems that the issue is tied to the multi-threaded kit. If I choose the single-threaded WebAssembly kit then everything works fine. Why would the "threadedness" make a difference?

      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