Skip to content

anzhi0708/example-rust-c-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Rust C FFI example

Keypoints

  • Add build = "src/build.rs" in Cargo.toml (otherwise cargo sometimes fails to pick it up and I don't know why)
  • #[link(name = "hello", kind = "dylib")] (or another kind; in this case a dylib)
  • cargo:rustc-link-search flag in build.rs file
  • Set environment variables correctly (Linux: LD_LIBRARY_PATH, Mac: DYLD_LIBRARY_PATH)

build_and_run bash script sets enviroment variables for you; you may want to take a look at it.

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy