webp icon indicating copy to clipboard operation
webp copied to clipboard

Not available in wasm

Open junichiro-watanabe opened this issue 2 years ago • 4 comments

...
  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?

junichiro-watanabe avatar Nov 21 '22 14:11 junichiro-watanabe

due to dependencies

https://github.com/NoXF/libwebp-sys/issues/11

kozakura913 avatar Nov 22 '22 00:11 kozakura913

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」フラグが問題を引き起こしているようです

kozakura913 avatar Nov 25 '22 12:11 kozakura913

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

junichiro-watanabe avatar Nov 29 '22 17:11 junichiro-watanabe

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...

kozakura913 avatar Dec 15 '22 00:12 kozakura913