Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installing as a Library

For Rust Projects

Add Matchy to your Cargo.toml:

[dependencies]
matchy = "1.0"

Then run cargo build:

$ cargo build
    Updating crates.io index
   Downloading matchy v1.0
     Compiling matchy v1.0
     Compiling your-project v0.1.0

That's it! You can now use Matchy in your Rust code.

For C/C++ Projects

Install the system-wide C library:

$ cargo install cargo-c
$ git clone https://github.com/sethhall/matchy
$ cd matchy
$ cargo cinstall --release --prefix=/usr/local

This installs:

  • Headers to /usr/local/include/matchy/
  • Library to /usr/local/lib/
  • pkg-config file to /usr/local/lib/pkgconfig/

Compile your project:

$ gcc myapp.c $(pkg-config --cflags --libs matchy) -o myapp

Option 2: Manual Installation

  1. Build the library:
$ git clone https://github.com/sethhall/matchy
$ cd matchy
$ cargo build --release
  1. Copy files:
$ sudo cp target/release/libmatchy.* /usr/local/lib/
$ sudo cp include/matchy.h /usr/local/include/
  1. Update library cache (Linux):
$ sudo ldconfig
  1. Compile your project:
$ gcc myapp.c -I/usr/local/include -L/usr/local/lib -lmatchy -o myapp

For Other Languages

Matchy provides a C API that can be called from any language with C FFI support:

  • Python: Use ctypes or cffi
  • Go: Use cgo
  • Node.js: Use node-ffi or napi
  • Ruby: Use fiddle or ffi

See the C API Reference for the full API specification.

Next Steps

Choose your language: