Closed mojerro closed 1 year ago
It is possible. Given your code/nm
output, it does seem like the symbol you’re attempting to load is mangled, and nm
is demangling it for you. libloading
does not automatically mangle or demangle symbols for you as described in the documentation for Library::get
. What you want is probably gonna start with a _Z
and will never contain ::
. Invoke nm --no-demangle
to get actual symbols that are usable with libloading
.
Make sure that the calling convention used on the C++ side and on the Rust side match.
Hope you can get it to work :)
o, I got it, I need to run nm -g --defined-only mylib.so
to let it work
I'm trying to load c++ class using this, but it's hard for me to finish it.
nm -g --defined-only -C mylib.so