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).
- Host: GitHub
- URL: https://github.com/sh1ftd/rust_cpp_example
- Owner: sh1ftd
- License: mit
- Created: 2025-04-14T18:23:59.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-04-15T16:24:49.000Z (8 months ago)
- Last Synced: 2025-04-19T06:42:24.532Z (8 months ago)
- Topics: cpp, ffi, foreign-language-interface, rust
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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