- ✅ 使用 Mojo 调用 C 动态库(
build/clib.so
)的方法. - ✅ main.mojo
# cd repo-root-dir/
# 编译+运行:
task ffi:mc:brd
# 运行:
task ffi:mc:rd
- ✅ 使用 Mojo 调用 C 静态库(
build/libclib.a
)的方法. - ✅ main2.mojo
- ❎ 当前似乎编译选项不支持静态库.
# cd repo-root-dir/
# 编译+运行:
task ffi:mc:brs
# 运行:
task ffi:mc:rs
- mojo version:
❯ magic run mojo -v
mojo 24.5.0 (e8aacb95)