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

Not available in wasm #20

Open
junichiro-watanabe opened this issue Nov 21, 2022 · 4 comments
Open

Not available in wasm #20

junichiro-watanabe opened this issue Nov 21, 2022 · 4 comments

Comments

@junichiro-watanabe
Copy link

...
  cargo:warning=#include <assert.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr


  error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "/Users/leping/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.4.2/vendor" "-Wall" "-Wextra" "-fvisibility=hidden" "-DNDEBUG=1" "-D_THREAD_SAFE=1" "-o" "/Users/leping/Desktop/online-webp-tool/target/wasm32-unknown-unknown/release/build/libwebp-sys-a70f591a50f6f57f/out/alpha_dec.o" "-c" "/Users/leping/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.4.2/vendor/src/dec/alpha_dec.c" with args "clang" did not execute successfully (status code exit status: 1).


Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

Can I use this crate in wasm?

@kozakura913
Copy link
Contributor

due to dependencies

NoXF/libwebp-sys#11

@kozakura913
Copy link
Contributor

kozakura913 commented Nov 25, 2022

You may be able to solve the problem by setting the environment variable
環境変数を設定する事で問題が解決できるかもしれません
export CC=clang-8

The '--release' flag seems to be causing the problem
「--release」フラグが問題を引き起こしているようです

@junichiro-watanabe
Copy link
Author

Thank you for your reply. I set CC=clang-8, but I got the same error.

@kozakura913
Copy link
Contributor

It looks like the "wasm32-unknown-unknown" target does not provide libc functionality.
"wasm32-unknown-emscripten" target might work

I don't know if that will help you achieve your goal...

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

2 participants