From 316ba7b338c199f4095da8089382681d2fd6354c Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 10 Jan 2021 15:15:38 +0800 Subject: [PATCH] feat: add test.c --- __misc/dotalib/Cargo.toml | 2 +- __misc/dotalib/README.md | 5 +++++ __misc/dotalib/test.c | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 __misc/dotalib/test.c diff --git a/__misc/dotalib/Cargo.toml b/__misc/dotalib/Cargo.toml index ac177ca..2c06958 100644 --- a/__misc/dotalib/Cargo.toml +++ b/__misc/dotalib/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -name = "dotalib" +name = "dota" crate-type = ["staticlib"] [dependencies] diff --git a/__misc/dotalib/README.md b/__misc/dotalib/README.md index aa9dd17..3222a52 100644 --- a/__misc/dotalib/README.md +++ b/__misc/dotalib/README.md @@ -12,3 +12,8 @@ C cbindgen --config cbindgen.toml --crate dotalib --lang c --output dotalib.h ``` +Compile +```shell +cargo build +gcc -Ltarget/debug/ -ldota test.c +``` \ No newline at end of file diff --git a/__misc/dotalib/test.c b/__misc/dotalib/test.c new file mode 100644 index 0000000..ac50146 --- /dev/null +++ b/__misc/dotalib/test.c @@ -0,0 +1,5 @@ +#include "dotalib.h" + +int main(int argc, char** argv) { + print_hello_world(); +}