Skip to content
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

Unresolved imports libc::c_void, libc::memcmp for WASM #1506

Closed
k06a opened this issue Sep 9, 2019 · 3 comments
Closed

Unresolved imports libc::c_void, libc::memcmp for WASM #1506

k06a opened this issue Sep 9, 2019 · 3 comments

Comments

@k06a
Copy link

k06a commented Sep 9, 2019

I just tried to use it for WASM:

ethereum-bigint = "0.2.9"
   Compiling ethereum-bigint v0.2.9
error[E0432]: unresolved imports `libc::c_void`, `libc::memcmp`
  --> /Users/k06a/.cargo/registry/src/github.com-1ecc6299db9ec823/ethereum-bigint-0.2.9/src/hash/mod.rs:25:36
   |
25 | #[cfg(feature = "std")] use libc::{c_void, memcmp};
   |                                    ^^^^^^  ^^^^^^ no `memcmp` in the root
   |                                    |
   |                                    no `c_void` in the root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `ethereum-bigint`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 9, 2019

Could you write down the command that you are using to compile ?

@JohnTitor
Copy link
Member

AFAIK they should be available and this is stale in over a year so I'm going to close this. Feel free to comment with additional information, I'm happy to re-open then :)

@kylebarron
Copy link

These are still not available for wasm32-unknown-unknown. If you try to compile a project using libc to wasm32-unknown-unknown, you'll get these errors. E.g with https://github.com/georust/geos/tree/e1dc4ec6623a3d9ca45a4b531a0bacd5522b5b85, I get:

> cargo build --target wasm32-unknown-unknown
   Compiling geos-sys v2.0.4 (/Users/kbarron/github/rust/geos/sys)
   Compiling num v0.4.0
warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`

error[E0432]: unresolved imports `libc::c_char`, `libc::c_double`, `libc::c_int`, `libc::c_uchar`, `libc::c_uint`, `libc::c_void`, `libc::size_t`
 --> sys/src/functions.rs:2:12
  |
2 | use libc::{c_char, c_double, c_int, c_uchar, c_uint, c_void, size_t};
  |            ^^^^^^  ^^^^^^^^  ^^^^^  ^^^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `size_t` in the root
  |            |       |         |      |        |       |
  |            |       |         |      |        |       no `c_void` in the root
  |            |       |         |      |        no `c_uint` in the root
  |            |       |         |      no `c_uchar` in the root
  |            |       |         no `c_int` in the root
  |            |       no `c_double` in the root
  |            no `c_char` in the root

error[E0432]: unresolved imports `libc::c_char`, `libc::c_double`, `libc::c_void`
 --> sys/src/types.rs:1:12
  |
1 | use libc::{c_char, c_double, c_void};
  |            ^^^^^^  ^^^^^^^^  ^^^^^^ no `c_void` in the root
  |            |       |
  |            |       no `c_double` in the root
  |            no `c_char` in the root

For more information about this error, try `rustc --explain E0432`.
warning: `geos-sys` (lib) generated 1 warning
error: could not compile `geos-sys` due to 2 previous errors; 1 warning emitted

This looks like a duplicate of #858 essentially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants