emscripten.h: No such file or directory
-
Hello,
I have
Qt WebAssemblyandemsdkinstalled. How to solve it?
I added
INCLUDEPATH:QT += core gui widgets INCLUDEPATH += "C:\emsdk\upstream\emscripten\system\include" CONFIG += c++17 SOURCES += \ main.cppThis 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.cppTo avoid
conflicting declarationdo not compile for Desktop. Compile for WebAssembly. -
I have tried to include
cache/sysroot/include directoryas in the message above:QT += core gui widgets INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include" CONFIG += c++17 SOURCES += \ main.cppBut 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.cppTo avoid
conflicting declarationdo not compile for Desktop. Compile for WebAssembly. -
8 8Observer8 has marked this topic as solved on