-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile time errors when including header file emscripten.h from $ENV{EMSDK}/upstream/emscripten/cache/sysroot/include/emscripten #22948
Comments
Can you share the full compiler output? I imagine you could be mixing system headers with emscripten headers, but the full output should make it clean what the problem is. |
Which LSP are you using? The primary include path for emscripten should be Can you not just tell the LSP to use |
Thanks @sbc100 for quick response. I use clangd. changing target to
this error occur because by default this config
uses clang++ not provided by emscripten
changing the config to use the emscripten provided clang++
this gives me next error
|
if it matters |
If you want to use em++/emcc with cmake the easiest way is to use The issues you are running into here are because cmake still thinks you are targetting windows, when you are not. |
Thank you for the suggestion @sbc100, I'll probably stick with the toolchain setup
|
If you use this line then you should not also need CMAKE_C_COMPILER_TARGET/CMAKE_C_COMPILER/etc since the |
Assuming that works can we close this issue? |
noted. |
this works and compiles successfully but still show lsp diagnostics errors cause of not including target directories for emscripten |
emcc - v3.1.71
including header file emscripten.h compiles successfully but it causes compile time error
which hinders code completion such as
emscripten_set_main_loop
.cmake config
for some unknown reason cmake can't include this specific path
so i use
instead.
first error
In included file: 'emscripten/em_macros.h' file not found
.solution
second new error
In included file: typedef redefinition with different types ('struct _iobuf' vs 'struct _IO_FILE') [redefinition_different_typedef]
.my naive solution
after the following changes compile time error gone and code completion now works.
The text was updated successfully, but these errors were encountered: