mirror of
https://github.com/vacp2p/zerokit.git
synced 2026-01-09 14:38:01 -05:00
Co-authored-by: vinhtc27 <vinhtc27@gmail.com> Co-authored-by: seemenkina <seemenkina@gmail.com> Co-authored-by: sydhds < sydhds@gmail.com>
841 B
841 B
Compile and Run
Non-stateless mode
Compile lib non-stateless
cargo build -p rln
cargo run --features headers --bin generate-headers
mv -v rln.h rln/ffi_c_examples/
Compile and run example non-stateless
cd rln/ffi_c_examples/
gcc -Wall main.c -o main -lrln -L../../target/debug
./main
Stateless mode
Compile lib stateless
cargo build -p rln --no-default-features --features stateless
cargo run --no-default-features --features stateless,headers --bin generate-headers
mv -v rln.h rln/ffi_c_examples/
Compile example stateless
cd rln/ffi_c_examples/
gcc -Wall -DSTATELESS main.c -o main -lrln -L../../target/debug
./main
Note
Find C lib used by Rust
cargo +nightly rustc --release -p rln -- -Z unstable-options --print native-static-libs