emscripten.h: No such file or directory
Solved
Qt for WebAssembly
-
Hello,
I have
Qt WebAssembly
andemsdk
installed. How to solve it?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:And here:
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". | ^~~~~
-
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. -
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;
-
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. -