Skip to content

robertschaedler3/a-little-c-with-your-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust + C

A little C/C++ with your Rust. The "Hello world" to building Rust apps with C/C++ libs.

Prerequisites

The easiest way to get started is by using the Visual Studio Code Remote - Containers / Codespaces development container included in this repository. This container comes with Rust, Cargo, and several VSCode extensions pre-installed to help you get started quickly.

  • For Remote - Containers, use the Remote-Containers: Open Repository in Container... command which creates a Docker volume for better disk I/O on macOS and Windows.
  • For Codespaces, install the GitHub Codespaces extension in VSCode, and use the Codespaces: Create New Codespace command.

Once your workspace is setup, open a terminal to check everything is working:

cargo --version
rustc --version

Build & Run

To build the project, run the following command:

cargo run

This will compile and link the C library using cmake-rs, generate the Rust bindings using bindgen, and run the application.

To pass arguments to the program, use the following command:

cargo run -- <arg>

About

The "hello world" to building Rust apps with C/C++ libs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published