---
title: "Discussion on \"A tutorial for accessing C/C++ functions within a shared library (.dll/.so/.dylib) from Rust\" | Hashnode"
description: "Discussion on \"A tutorial for accessing C/C++ functions within a shared library (.dll/.so/.dylib) from Rust\". [19-09-2023] Updates:\n\nAdd instructions and code for an alternative way to build and run using build.rs and cmake-rs\n\nFix the reason why not to link to C++ functions directly\n\nInclude <cstring> in the code and use free instead of delete as strdup gen..."
url: "https://hashnode.com/posts/a-tutorial-for-accessing-cc-functions-within-a-shared-library-dllsodylib-from-rust/638c59ea764815b4080dfd9f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A tutorial for accessing C/C++ functions within a shared library (.dll/.so/.dylib) from Rust](https://blog.srikanth.one/a-tutorial-for-accessing-cc-functions-within-a-shared-library-dllsodylib-from-rust?utm_source=hashnode&utm_medium=feed)

\[19-09-2023\] Updates: Add instructions and code for an alternative way to build and run using build.rs and cmake-rs Fix the reason why not to link to C++ functions directly Include <cstring> in the code and use free instead of delete as strdup gen...

Dec 4, 2022 · 7 min read · blog.srikanth.one  
Updated Sep 19, 2023  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#cpp](https://hashnode.com/tag/cpp)
-   [#c](https://hashnode.com/tag/c)
-   [#ffi](https://hashnode.com/tag/ffi)

## Written by

[Srikanth Anantharam](https://hashnode.com/@sria91)

@sria91 · Bengaluru, Karnataka, India

  
[View profile](https://hashnode.com/@sria91)

Software Practitioner | Lifelong Learner

Software Practitioner | Lifelong Learner

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
