Open leejw51crypto opened 2 years ago
If you're using cxxbridge
to generate lib.rs.h
, you need to add the flag --include rust/cxx.h
which will notify cxxbridge
that you have this header available and not duplicate the definitions in the generated headers or source files.
I stumbled on this issue and have basically the same need. I'm confused by the answer though -- where exactly do I put this flag?
I tried:
cxx_build::bridge(&filename)
.flag("--include rust/cxx.h")
.flag_if_supported("-std=c++17")
.compile(name.as_str());
...and that didn't work. So I'm missing something...
in using multiple bridge files, some classes are redundant. it's surrounded by
CXXBRIDGE1_RUST_STRING
etc.is it possible to remove this redundancy?