Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown type name 'wchar_t' if using as a function parameter #1406

Closed
aleksmelnikov opened this issue Oct 3, 2018 · 2 comments
Closed

Unknown type name 'wchar_t' if using as a function parameter #1406

aleksmelnikov opened this issue Oct 3, 2018 · 2 comments

Comments

@aleksmelnikov
Copy link

Input C/C++ Header

// test.h
int set_settings(const wchar_t *settings);

Bindgen Invocation

$ bindgen test.h -o test.rs

Actual Results

test.h:3:24: error: unknown type name 'wchar_t'
test.h:3:24: error: unknown type name 'wchar_t', err: true
thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Aborted

Expected Results

I expect a normal generation.

Additional info

bindgen --version
bindgen 0.41.0
@auscompgeek
Copy link
Contributor

wchar_t is defined in stddef.h. Your header file needs to #include <stddef.h>.

@emilio
Copy link
Contributor

emilio commented Oct 3, 2018

Yeah, this is not a bindgen bug, that's a clang error due to a missing include.

Thanks for the report though!

@emilio emilio closed this as completed Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants