Git Product home page Git Product logo

rust2cpp's Introduction

Rust2Cpp

This project exists as an example of how to call functions in a C++ library from Rust. The solution within this repository currently contains two projects, Once CPP project and one Rust project.

The CPP project is located under the cpp directory and contains a simple CMake configuration to build a shared library called "cppoxide".

The Rust project is just located within the main directory and calls the C++ shared library through the use of Rust FFI interface.

CPP Instructions

Build the Cpp project by running the following command from the cpp directory.

cmake -B target -S . && make
cd target 
sudo make install

This will make and compile the Cpp project and install the shared library into your default lib directory.

Very IMPORTANT NOTE:

In order for rust to find you shared libraries you must make sure that you have set the proper environment variable:

export LD_LIBRARY_PATH=/usr/local/lib

Rust Instructions

The Rust program takes and image file as input, reads the image bytes, and passes this array to the cppoxide library for analysis.

Build and run the Rust program by running the following commands:

cargo build
cargo run </path/to/some/image>

rust2cpp's People

Contributors

sjbeskur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.