外观
Rust动态模块
约 102 字小于 1 分钟
2025-10-30
创建库项目
cargo new etml_dylib --lib声明为 C ABI 兼容的动态库
在 Cargo.toml 中添加:
[lib]
crate-type = ["cdylib"]cdylib 类型: A dynamic system library will be produced. This is used when compiling a dynamic library to be loaded from another language. This output type will create *.so files on Linux, *.dylib files on macOS, and *.dll files on Windows.
相关信息
更多 crate-type 类型含义参考 这里
