Closed SDAChess closed 4 months ago
When trying to reproduce this in a simpler example I am not running into the same issue. I will keep you updated on this but it might be an issue on my side.
Okay, turns out that if you forget to annotate a member function with the #[namespace]
directive, it will still work because cxx will find the member function, but the generated code won't be put in the correct namespace. I don't think this is a bug but a bit troubling at first. Closing this.
Hello,
I am trying to build C++ bindings for my Rust code and I'm hitting the following problem. I have two libraries (libA and libB) that both defines the same symbols, under a different namespace (libA::test and libB::test) for instance.
When creating bindings for both these functions, I get a linking error from Cargo saying that symbols are defined mutiple times.
I assume this is because CXX generates the bridge code in the top level namespace.
Do you have any ideas/solutions.
I'm guessing generating the bridge code in separate namespaces (for instance the one given in the
compile
function for the bridge) would fix this issue but maybe this is not possible for FFI?Thank you very much.