【发布时间】:2020-02-18 09:02:25
【问题描述】:
我在使用wasi-libc时尝试使用fopen读取图像:
#include <stdio.h>
int main()
{
FILE *f = fopen("test.png", "rb");
printf("file %p\n", f);
fclose(f);
}
使用 Clang 构建代码:
$ clang --target=wasm32-wasi --sysroot=/opt/wasi-sdk/share/wasi-sysroot/ test.c -o test.wasm
$ wasmtime test.wasm
$ file 0
它返回 NULL。我该如何解决这个问题?
【问题讨论】:
标签: clang fopen libc wasi wasmtime