Open qdwang opened 1 month ago
0.12.0
const jpegli = @cImport({ @cInclude("stddef.h"); @cInclude("stdio.h"); @cInclude("jpeglib.h"); });
The jpeglib.h doesn't include stddef.h and stdio.h, so the types inside like size_t and FILE will cause errors: error: unknown type name X.
jpeglib.h
stddef.h
stdio.h
size_t
FILE
error: unknown type name X
So I added @cInclude("stddef.h") and @cInclude("stdio.h"). The problem is: error: unknown type name 'FILE' still occurs.
@cInclude("stddef.h")
@cInclude("stdio.h")
error: unknown type name 'FILE'
When target is wasm32-freestanding, there is no problem at all. The issue only happens in wasm32-emscripten.
wasm32-freestanding
wasm32-emscripten
It should compile.
Zig doesn't support libc for wasm32-emscripten.
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
The
jpeglib.h
doesn't includestddef.h
andstdio.h
, so the types inside likesize_t
andFILE
will cause errors:error: unknown type name X
.So I added
@cInclude("stddef.h")
and@cInclude("stdio.h")
. The problem is:error: unknown type name 'FILE'
still occurs.When target is
wasm32-freestanding
, there is no problem at all. The issue only happens inwasm32-emscripten
.Expected Behavior
It should compile.