-
Notifications
You must be signed in to change notification settings - Fork 741
Generated code from C++ headers does not compile #1490
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
Comments
So I couldn't build it, but rustc is pointing to the right location for the error, it's just that the file is in one massive line (since rustfmt cannot parse it either) and it basically covers the whole screen. If you add a bunch of newlines the error points to:
So this looks like a dupe of #1464. A test-case for it would be really amazing. In any case, looks like your bindgen invocation is not doing what you think it's doing, you probably want: @@ -57,7 +35,7 @@ fn main() {
.clang_arg("-std=c++17")
.clang_arg("-x")
.clang_arg("c++")
- .opaque_type("std::*")
+ .opaque_type("std::.*")
.whitelist_type("seal::SEALContext")
.whitelist_function("seal::SEALContext::Create")
.generate() So that the regex works as you expect. |
I subscribed to the other issue, thank you for your help. |
Also, sorry about the example not working, I had commented one too many line. With |
I cannot reopen the issue, but I am fairly sure that there is a real bug here. Using the changes above, the
Which causes the expected compilation error:
For reference, here is the relevant header file. For now, I have found that simply replacing |
This is not expected behavior, but there's #1464 tracking this same problem, so it's pointless to have two different issues. |
#1464 it's not about bad indentation, but about a type being not correctly generated thinking that But I agree it could be a different issue, mind opening a new one for that? |
Done! Please tell me if you need anything else. |
I am trying the wrap Microsoft's SEAL library
Input C/C++ Header
Yes this include other includes that impact reproduction of the bug BUT you can simply clone my project here and build it to get the error.
Bindgen Invocation
Actual Results
See https://github.com/Belval/seal-rs/blob/master/src/bindings.rs for the generated binding.rs file
Expected Results
I just expected it to build and or provide a decent error message. In this case
rustc
simply can't compile it but I am not given any kind of hint as to what is wrong.As a final note simply ask if you need anything else, I suppose I might be within the limits of the library when using C++ 17 but the documentation is unclear (at least to me) as to what is incompatible here.
The text was updated successfully, but these errors were encountered: