Bromeon/js-sandbox

unresolved import `libc::c_char` when compiled to WASM

chaosprint opened this issue · 1 comments

cargo new js-sandbox-test --lib

Add in cargo.toml:

[dependencies]
js-sandbox = "0.1.6"

Then compile:

cargo build --target wasm32-unknown-unknown --release

Got error:

   Compiling serde_derive v1.0.136
   Compiling futures-macro v0.3.21
   Compiling pin-project-internal v1.0.10
   Compiling rusty_v8 v0.22.3
error[E0432]: unresolved import `libc::c_char`
 --> /Users/chaosprint/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.22.3/src/V8.rs:2:5
  |
2 | use libc::c_char;
  |     ^^^^^^^^^^^^ no `c_char` in the root

error[E0432]: unresolved import `libc::c_int`
 --> /Users/chaosprint/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.22.3/src/V8.rs:3:5
  |
3 | use libc::c_int;
  |     ^^^^^^^^^^^ no `c_int` in the root

For more information about this error, try `rustc --explain E0432`.