我有一个hello.c
包含以下内容的简单文件:
#include <emscripten.h>
#include <stdlib.h>
#include <stdio.h>
int main() {
printf("hello wasm\n");
}
我正在尝试使用以下命令将其编译为.html
with emscriptenemcc
命令:
emcc hello.c --emrun -o hello.html
但我得到的输出是:
emcc: warning: LLVM version appears incorrect (seeing "10.0", expected "11.0") [-Wversion-check]
clang-10: error: unknown argument: '-fignore-exceptions'
emcc: error: '/usr/local/opt/llvm/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=18 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/compat -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/libc -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/lib/libc/musl/arch/emscripten -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/local/include -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/SSE -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/cache/wasm/include -DEMSCRIPTEN -fignore-exceptions hello.c -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/SDL -c -o /var/folders/74/19dk0c293ps0fmfj5vsqld1w0000gn/T/emscripten_temp_xakv8jzi/hello_0.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
我通过自制软件安装了 emscripten 和依赖项。这些是我的必要出口.zshrc
:
export LLVM="/usr/local/opt/llvm/bin"
export BINARYEN="/usr/local/opt/binaryen/bin"
我怎样才能让它工作?