cargo-c

(โ˜… 545)

build and install C-compatible libraries

  • .gitignore
  • Cargo.toml
  • codecov.yml
  • coverage.sh
  • LICENSE
  • README.md

# Installation Guide

1. Get the code
git clone https://github.com/lu-zero/cargo-c

Downloads the entire project code from GitHub to your computer.

cd cargo-c

Moves into the project folder you just downloaded.

2. Rust

Medium Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Rust (rustup) Installing via rustup also installs cargo.
The `rustc` version supported is the same as the one supported by the `cargo` version embedded in the package version, or as set in the

Type this command into your terminal and run it.

[rust-version](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field) field.

Type this command into your terminal and run it.

You must have the **cargo** build [requirements](https://github.com/rust-lang/cargo#compiling-from-source) satisfied in order to build **cargo-c**:

Type this command into your terminal and run it.

For a more in-depth explanation of how `cargo-c` works and how to use it for

Type this command into your terminal and run it.

- ~~Since Rust 1.38, also add "staticlib" to the "lib" `crate-type`.~~ Do not specify the `crate-type`, cargo-c will add the correct library target by itself.

Type this command into your terminal and run it.

โœ… If cargo build finishes without errors, it worked. The executable is created under target/.

Pulled directly from this repo's README.

3. Make

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
โš ๏ธ This is a large repository, so this method may point to an internal sub-package rather than the actual core product. Check the full README as well.
cd example-project/usage-from-c

This project's files live in a subfolder, so move into it first.

make

Compiles the code based on the generated build configuration to produce an executable.

โœ… If it finishes without errors, it worked. Try running the generated executable directly.
// repository documentation