【发布时间】:2020-04-20 01:30:28
【问题描述】:
我正在尝试将一个简单的 hello world 程序从 C 语言编译成 Web 程序集。我一直在遵循 MDN (https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm) 提供的指南。通过 Firefox 71 导航到 HTML 页面后,我收到了 TypeError: “NetworkError when attempting to fetch resource.” 错误。
这是 C 代码:
#include <stdio.h>
int
main(int argc, char *argv[]) {
printf("hello, world!");
return 0;
}
以及用于编译的命令:
emcc hello.c -s WASM=1 -o hello.html
我错过了什么吗?有没有其他人遇到过这个问题?提前谢谢你。
【问题讨论】:
标签: c webassembly