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. emscripten.h: No such file or directory

emscripten.h: No such file or directory

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
3 Posts 1 Posters 477 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.
  • 8 Offline
    8 Offline
    8Observer8
    wrote on 30 May 2024, 12:10 last edited by 8Observer8
    #1

    Hello,

    I have Qt WebAssembly and emsdk installed. How to solve it?

    db420dc9-54da-4327-8314-3a65a26cd0b7-image.png

    I added INCLUDEPATH:

    QT  += core gui widgets
    
    INCLUDEPATH += "C:\emsdk\upstream\emscripten\system\include"
    
    CONFIG += c++17
    
    SOURCES += \
        main.cpp
    

    This directory has two emscripten.h. Here:

    33170212-0173-4bf7-925f-3e2401e4583f-image.png

    And here:

    ae6f7562-725a-43f9-b46f-8cd9ab6864c6-image.png

    But it doesn't work too: "Including files directly from the emscripten source tree is not supported. Please use the cache/sysroot/include directory"

    C:\emsdk\upstream\emscripten\system\include\emscripten\version.h:8: error: #error "Including files directly from the emscripten source tree is not supported.  Please use the cache/sysroot/include directory".
    In file included from C:/emsdk/upstream/emscripten/system/include/emscripten/emscripten.h:29,
                     from ..\..\main.cpp:5:
    C:/emsdk/upstream/emscripten/system/include/emscripten/version.h:8:2: error: #error "Including files directly from the emscripten source tree is not supported.  Please use the cache/sysroot/include directory".
        8 | #error "Including files directly from the emscripten source tree is not supported.  Please use the cache/sysroot/include directory".
          |  ^~~~~
    
    1 Reply Last reply
    0
    • 8 Offline
      8 Offline
      8Observer8
      wrote on 30 May 2024, 13:35 last edited by
      #3

      Solution is to add the following INCLUDEPATH:

      QT  += core gui widgets
      
      INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include"
      
      CONFIG += c++17
      
      SOURCES += \
          main.cpp
      

      To avoid conflicting declaration do not compile for Desktop. Compile for WebAssembly.

      1 Reply Last reply
      0
      • 8 Offline
        8 Offline
        8Observer8
        wrote on 30 May 2024, 13:32 last edited by 8Observer8
        #2

        I have tried to include cache/sysroot/include directory as in the message above:

        QT  += core gui widgets
        
        INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include"
        
        CONFIG += c++17
        
        SOURCES += \
            main.cpp
        

        But I have this error: conflicting declaration 'typedef struct div_t div_t' 64 | typedef struct { int quot, rem; } div_t;

        1 Reply Last reply
        0
        • 8 Offline
          8 Offline
          8Observer8
          wrote on 30 May 2024, 13:35 last edited by
          #3

          Solution is to add the following INCLUDEPATH:

          QT  += core gui widgets
          
          INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include"
          
          CONFIG += c++17
          
          SOURCES += \
              main.cpp
          

          To avoid conflicting declaration do not compile for Desktop. Compile for WebAssembly.

          1 Reply Last reply
          0
          • 8 8Observer8 has marked this topic as solved on 30 May 2024, 13:35

          3/3

          30 May 2024, 13:35

          • Login

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