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
Hi, I am trying to share a bunch of shared types between crates in the same workspace. However, when running the build command it complains of two things:
If I add the include!("core/src/lib.rs.h") line in the "consumer" crate the build fails because the file does not exists. Which make sense, there is no file with such a name. I just tried this based on issue Define shared struct in separate file #1077 .
But if I don't put that line then the build process fails because of the following errors:
...
cargo:warning= | ^
cargo:warning=/home/hector/git/hectormrc/cxx-bridge/target/debug/build/consumer-86186167f538f322/out/cxxbridge/sources/consumer/src/lib.rs.cc:86:57: error: ‘::MySharedStruct’ has not been declared
cargo:warning= 86 | void cxxbridge1$do_another_thing(::MySharedStruct *t, ::MySharedStruct *return$) noexcept;
cargo:warning= | ^~~~~~~~~~~~~~
cargo:warning=/home/hector/git/hectormrc/cxx-bridge/target/debug/build/consumer-86186167f538f322/out/cxxbridge/sources/consumer/src/lib.rs.cc:86:73: error: ‘return$’ was not declared in this scope
cargo:warning= 86 | void cxxbridge1$do_another_thing(::MySharedStruct *t, ::MySharedStruct *return$) noexcept;
cargo:warning= | ^~~~~~~
cargo:warning=/home/hector/git/hectormrc/cxx-bridge/target/debug/build/consumer-86186167f538f322/out/cxxbridge/sources/consumer/src/lib.rs.cc:89:3: error: ‘MySharedStruct’ in namespace ‘::’ does not name a type
cargo:warning= 89 | ::MySharedStruct do_another_thing(::MySharedStruct t) noexcept {
cargo:warning= |
...
--- stderr
CXX include path:
/home/hector/git/hectormrc/cxx-bridge/target/debug/build/consumer-86186167f538f322/out/cxxbridge/include
/home/hector/git/hectormrc/cxx-bridge/target/debug/build/consumer-86186167f538f322/out/cxxbridge/crate
The full example can be found here: cxx bridge example
But in a nutshell my "core" crate is exposing a dummy type like this:
What am I missing here? Using cxx_build::bridges the same thing happens. I also tried to generate first the headers files for the core crate, and then import them via include! to the consumer one, but it does not seams to find them out.
The text was updated successfully, but these errors were encountered:
Hi, I am trying to share a bunch of shared types between crates in the same workspace. However, when running the
build
command it complains of two things:include!("core/src/lib.rs.h")
line in the "consumer" crate the build fails because the file does not exists. Which make sense, there is no file with such a name. I just tried this based on issue Define shared struct in separate file #1077 .The full example can be found here: cxx bridge example
But in a nutshell my "core" crate is exposing a dummy type like this:
And the consumer is trying to use it like the following:
Finally, everything is meant to get build together using the following
build.rs
inside the consumer crate:What am I missing here? Using
cxx_build::bridges
the same thing happens. I also tried to generate first the headers files for the core crate, and then import them viainclude!
to the consumer one, but it does not seams to find them out.The text was updated successfully, but these errors were encountered: