One of my dependency uses C to build. When I run wasm-pack build --target web
, it throws an error saying that the standard libraries are not found.
running: "clang" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "wasm-shim/" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DXXH_STATIC_ASSERT=0" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "C:\\Users\\ytdan\\OneDrive\\Desktop\\Projects\\my-solid-project\\my-crate\\target\\wasm32-unknown-unknown\\release\\build\\zstd-sys-c5af62873173d597\\out\\zstd/lib/legacy\\zstd_v02.o" "-c" "zstd/lib/legacy\\zstd_v02.c"
exit code: 1
cargo:warning=1 error generated.
exit code: 1
cargo:warning=zstd/lib/legacy\zstd_v01.c:161:10: fatal error: 'stdio.h' file not found
cargo:warning=#include <stdio.h> /* printf (debug) */
cargo:warning= ^~~~~~~~~
cargo:warning=1 error generated.
exit code: 1
cargo:warning=zstd/lib/legacy\zstd_v02.c:989:10: fatal error: 'stdio.h' file not found
cargo:warning=#include <stdio.h> /* printf (debug) */
I tried both installations of clang via MSYS2 and Microsoft Build Tools but to no avail. Any ideas how I can direct my compiler to look at the standard libraries while using wasm-pack?