An open API service indexing awesome lists of open source software.

https://github.com/sh1ftd/rust_cpp_example

A simple demonstration of calling C++ code from Rust using FFI (Foreign Function Interface).
https://github.com/sh1ftd/rust_cpp_example

cpp ffi foreign-language-interface rust

Last synced: 5 months ago
JSON representation

A simple demonstration of calling C++ code from Rust using FFI (Foreign Function Interface).

Awesome Lists containing this project

README

          

# Rust-CPP example

This is just an example implementation of cc-rs crate.

It counts prime numbers up to a given number using the Sieve of Eratosthenes algorithm implemented in C++.

## Requirements

- Rust (2024 edition)
- C++17 compatible compiler
- Windows: Visual Studio Build Tools with C++ support

## Building

```bash
cargo build --release
```

## Credits

- Uses [cc-rs](https://github.com/rust-lang/cc-rs) for C++ compilation and linking

## License

MIT