Rust std lib linked as dynamic lib

Cargo is always pass " -c prefer-dynamic" and linking std dynamically if one of the dependency is "dylib". Can it be linked statically?

Are you making a portable library? If so, then you need cdyilb type and export a C API.

dylib is for Rust libs, which don't have a stable ABI, so dependence on libstd is the least of their problems :slight_smile:

No, i not making a portable library. I split my main app with one nested crate which type i make dylib for optimize final compile and link time. But then all my app have std linked dynamically. Can it be linked staticaly?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.