Open
Description
Bindgen documentation says to add -x c++
to parse c++ headers, so I've done what seems to be logical: .clang_arg("-x c++")
. This caused quite unhelpful error:
--- stderr
thread 'main' panicked at 'libclang error; possible causes include:
- Invalid flag syntax
- Unrecognized flags
- Invalid flag arguments
- File I/O errors
If you encounter an error missing from this list, please file an issue or a PR!', libcore\option.rs:960:5
I've manually checked that clang takes this param without problem. So, it is bindgen doing something strange to this param. Unfortunately the exact clang command line is not shown in output, thus leaving me unable to troubleshoot. Googling did help to answer the mystery with advice to do .clang_arg("-x").clang_arg("c++").
but it should be documented.
Expected changes:
- Document in
clang_arg
(andclang_args
?) that space separated arguments must be set in individual calls. - Is it possible for
clang_arg
to behave with the principle of least surprise and work with spaces as expected? - Amend tutorial's C++ section and provide code snippet how to add c++ support.
- Print clang command line to output so people could troubleshoot problems like this one.