-
Notifications
You must be signed in to change notification settings - Fork 745
Improve troubleshooting experience #1456
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yeah, I agree this is unfortunate. The right fix is fixing libclang so that we can get a diagnostic of why the translation unit creation failed. But we should be able to detect at least a few common cases I guess. The annoying bit of just using |
what about adding a bindgen option to do this: |
Personally I really think "cpp" should always mean "the C preprocessor" and not "C++", but I probably lost that battle. I personally could imagine |
yeah |
This issue probably overlaps #1855. |
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: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:
clang_arg
(andclang_args
?) that space separated arguments must be set in individual calls.clang_arg
to behave with the principle of least surprise and work with spaces as expected?The text was updated successfully, but these errors were encountered: