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
I have a rust library that I exposed to to c++ with cxx and corrosion_add_cxxbridge. That is used in a non Qt related part of the application.
I want to create a qobject in c++ using cxx-qt. So I follow the book tutorial, and I get linker error due to duplicate symbols of some cxx types (Slices, Str, etc...).
Workaround I will go for know is to add more bindings to my first rust library, so I only have one library. And I will wrap the behavior I wanted to add to a qt object writing the QObject in c++, calling the rust binding.
My question is, is there another workaround that you are aware of? My first library only has 4 functions using cxx types (rust::Slices mostly and scalar). Would it be possible to just add those 4 functions binding inside a cxx-qt library?
The text was updated successfully, but these errors were encountered:
OlivierLDff
changed the title
Is there a way to integrate with other cxx binding library
Is there a way to integrate with other cxx libraries
May 31, 2023
There may be multiple complex issues here. First, regardless of cxx, Rust symbols need to be linked into every Rust library/executable, so you get duplicate symbol errors when trying to link multiple Rust staticlibs into one executable: #148. AFAIK the only workaround for this is to have one top level Rust staticlib crate with all the other Rust crates you're using as normal rlib dependencies.
Second, I don't know if cxxbridge and cxx-qt-build are compatible. This hasn't been tested.
Hi here is my setup.
cxx
andcorrosion_add_cxxbridge
. That is used in a non Qt related part of the application.cxx-qt
. So I follow the book tutorial, and I get linker error due to duplicate symbols of some cxx types (Slices, Str, etc...).This seem to be a known issue corrosion-rs/corrosion#398.
Workaround I will go for know is to add more bindings to my first rust library, so I only have one library. And I will wrap the behavior I wanted to add to a qt object writing the QObject in c++, calling the rust binding.
My question is, is there another workaround that you are aware of? My first library only has 4 functions using cxx types (rust::Slices mostly and scalar). Would it be possible to just add those 4 functions binding inside a cxx-qt library?
The text was updated successfully, but these errors were encountered: