When compiling eframe in wasm32-unknown-emscripten, an error occurred. What should I do? #4601
Unanswered
Aladdinslamp
asked this question in
Q&A
Replies: 1 comment
-
It looks like the glow API for emscripten is the same as for native, and different from other wasm32. https://github.com/grovesNL/glow/blob/e4a9a702111c425abdf9febef3ec2f2ce4822c26/src/lib.rs#L15-L26 And eframe does not make this distinction. Lines 158 to 168 in 78dfdb3 The wgpu backend also has a similar problem. So it seems like eframe is not compatible with the emscripten target at the moment. You could open an issue about it, to at least document that it doesn't work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The issue with Emscripten compilation is as follows:
cargo build --target=wasm32-unknown-emscripten
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.27.0\src\web\web_painter_glow.rs:118:29
|
118 | let gl = glow::Context::from_webgl1_context(gl1_ctx);
| ^^^^^^^^^^^^^^^^^^^ function or associated item not found in Context
|
note: if you're trying to build a new glow::Context consider using one of the following associated functions:
glow::Context::from_loader_function_cstr
glow::Context::from_loader_function
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\glow-0.13.1\src\native.rs:42:5
|
42 | / pub unsafe fn from_loader_function_cstr(mut loader_function: F) -> Self
43 | | where
44 | | F: FnMut(&CStr) -> *const std::os::raw::c_void,
| |_^
...
104 | / pub unsafe fn from_loader_function(mut loader_function: F) -> Self
105 | | where
106 | | F: FnMut(&str) -> *const std::os::raw::c_void,
| |^
error[E0599]: no function or associated item named from_webgl2_context found for struct glow::Context in the current scope
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.27.0\src\web\web_painter_glow.rs:134:29
|
134 | let gl = glow::Context::from_webgl2_context(gl2_ctx);
| ^^^^^^^^^^^^^^^^^^^ function or associated item not found in Context
|
note: if you're trying to build a new glow::Context consider using one of the following associated functions:
glow::Context::from_loader_function_cstr
glow::Context::from_loader_function
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\glow-0.13.1\src\native.rs:42:5
|
42 | / pub unsafe fn from_loader_function_cstr(mut loader_function: F) -> Self
43 | | where
44 | | F: FnMut(&CStr) -> *const std::os::raw::c_void,
| |_^
...
104 | / pub unsafe fn from_loader_function(mut loader_function: F) -> Self
105 | | where
106 | | F: FnMut(&str) -> *const std::os::raw::c_void,
| |^
Beta Was this translation helpful? Give feedback.
All reactions