You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A struct with methods gets processed nicely by bindgen, autocxx and cxx.
A class with methods results in compile warnings because:
bindgen outputs a Rust struct
autocxx passes struct-like information to cxx
cxx generates C++-side bindings which include a forward declaration for this class... but calls it a struct. Therefore the compiler whines. Apparently on Windows this would actually be a bug due to ABI mismatch between structs and classes. (In the title of the issue I call this a 'build failure' but I'm not sure).
Currently the information output from bindgen doesn't tell us whether something is a class or a struct. We will need a small bindgen change to add a bit more information to the outputted code. I have a hacky branch for this; if anyone wants to clean it up let me know and I'll upload the hacks somewhere.
The text was updated successfully, but these errors were encountered:
Taking another look here: this problem doesn't seem to exist any more. It might be that cxx has changed to no longer generate those forward declarations. I also now regret not adding a citation for the bit labelled "apparently" above: I'm sure I wasn't imagining it but I can't find it. I'll close this issue for now though I'm pretty confident it'll reappear.
A struct with methods gets processed nicely by
bindgen
,autocxx
andcxx
.A class with methods results in compile warnings because:
bindgen
outputs a Rust structautocxx
passes struct-like information tocxx
cxx
generates C++-side bindings which include a forward declaration for thisclass
... but calls it astruct
. Therefore the compiler whines. Apparently on Windows this would actually be a bug due to ABI mismatch between structs and classes. (In the title of the issue I call this a 'build failure' but I'm not sure).Currently the information output from
bindgen
doesn't tell us whether something is a class or a struct. We will need a small bindgen change to add a bit more information to the outputted code. I have a hacky branch for this; if anyone wants to clean it up let me know and I'll upload the hacks somewhere.The text was updated successfully, but these errors were encountered: