Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of linking against a C++ shared library #725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

domfarolino
Copy link

@domfarolino domfarolino commented Feb 18, 2025

fixes #294 and contributes to #328.

Please take a look @budziq, I'd love for the cookbook to have a simple example of Rust dynamically linking against a C/C++ shared library through a C ABI.


Things to check before submitting a PR

  • the tests are passing locally with cargo xtask test all
    • Note: almost every test fails for me locally. I'm not sure why, but I'm pretty sure it is not related to my commits.
  • commits are squashed into one and rebased to latest master
  • PR contains correct "fixes #ISSUE_ID" clause to autoclose the issue on PR merge
  • non rendered items are in sorted order (links, reference, identifiers, Cargo.toml)
    • Question: Sorted how? Lexicographically, or by use (i.e., link reference/use)
  • links to docs.rs have wildcard version https://docs.rs/tar/*/tar/struct.Entry.html
  • example has standard error handling
    • My liberal use of .unwrap() in basic helper code I think is OK here? But I'd love for someone to confirm!
  • code identifiers in description are in hyperlinked backticks
[`Entry::unpack`]: https://docs.rs/tar/*/tar/struct.Entry.html#method.unpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add "Compile and link dynamically to an external C library" example
1 participant