Open ahaoboy opened 2 months ago
you need to tell clang
where to find such headers for that platform.
you need to tell
clang
where to find such headers for that platform.
Can you explain this in more detail? How do I use the parameters passed to clang, because I don't know where the header files are exactly, and using other targets, it doesn't give me an error, is it because the environment is missing some libraries?
bindgen ./test.h -o test.rs -- --target=x86_64-unknown-linux-gnu
Yes, clang
cannot find any stdio.h
header for the wasm32-unknown-unknown
target in the directories where system headers usually are. So you need to get the right toolchain for that target or use a target for which you actually have the headers.
I haven't ever cross compiled to wasm but I found this post stating that wasm32-unknown-unknown
requires a special toolchain.
I found this post stating that
wasm32-unknown-unknown
requires a special toolchain.
This shows that many people have encountered the same problem, but we must use some cumbersome methods to bypass this problem. Using new toolchains such as zig-cc will increase the complexity. And this blog seems to be released on 2023-01-01, we can only look forward to subsequent support.
I don't think we can do anything from the bindgen side to alleviate this.
Input C/C++ Header
Bindgen Invocation
stdlib.h, inttypes.h, string.h, assert.h also have the same problem
Actual Results
Expected Results
No errors and compiled successfully