Skip to content

marmidr/rustycpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test program linking Rust library to C++ program

Based on: https://dev.to/dandyvica/how-to-call-rust-functions-from-c-on-linux-h37

How to build

Assuming that g++, make, cargo are installed:

make

Run test program

make run

MSys2 - installing Rust in CLang64

We are using CLang64 because cargo/rust are not available for plain MSys.

In the console: C:\msys64\clang64.exe:

pacman -Ss cargo
pacman -S clang64/mingw-w64-clang-x86_64-cargo-c
cargo -V
# cargo 1.65.0

List the symbols

LD_LIBRARY_PATH=target/debug ldd ./target/cppcaller

About

Call Rust lib from the C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published