#include "txm.h"
#include <stdio.h>
int main() {
char *out = txm_render("E = mc^2");
if (out) {
printf("%s\n", out);
txm_free_string(out);
}
return 0;
}Build the shared / static library:
cd bindings/c
cargo build --releaseThe compiled library will be at target/release/libtxm_c.{so,dylib,a}.
Link it with your C/C++ program:
# Dynamic linking (set LD_LIBRARY_PATH=target/release at runtime)
cc -o example example.c -L target/release -ltxm_c
# Static linking
cc -o example example.c target/release/libtxm_c.a