Closed Ghamza-Jd closed 1 year ago
When I looked into the generated .cc
file, I found implementation for the Box
but for the Str
I could only find interface definition
It worked now using CxxString
, but I'm curious why both &str
and String
aren't working
The crate type was crate-type = ["cdylib", "staticlib"]
, I've removed the cdylib
and the types that weren't working are now working. So now I can use Rust
, &str
, and String
same issue, and I what to know why?
Hey 👋🏻
I'm trying to pass a string from C++ to Rust, but whenever I try to pass that, I got:
Now, here's a minimal example of what I'm doing:
I've tried passing creating an opaque type consist of primitive types like
u32
, it worked and I was able to call a function with a reference to the opaque type.But when dealing with
&str
andString
the mentioned compiler error appears.Thanks!