Skip to content

Classes result in build warnings; build failure on Windows #54

Closed
@adetaylor

Description

@adetaylor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions