{"id":32418406,"url":"https://github.com/anzhi0708/example-rust-c-ffi","last_synced_at":"2026-05-05T17:32:42.051Z","repository":{"id":276640327,"uuid":"929849752","full_name":"anzhi0708/example-rust-c-ffi","owner":"anzhi0708","description":"Minimal example for calling C function from Rust code","archived":false,"fork":false,"pushed_at":"2025-04-19T12:04:42.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T16:56:15.645Z","etag":null,"topics":["build","build-system","c","cargo","clang","example","examples","examples-rust","ffi","foreign-function-interface","rust","std","stdlib"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anzhi0708.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T14:56:07.000Z","updated_at":"2025-04-19T12:04:45.000Z","dependencies_parsed_at":"2025-02-10T08:15:26.008Z","dependency_job_id":null,"html_url":"https://github.com/anzhi0708/example-rust-c-ffi","commit_stats":null,"previous_names":["anzhi0708/example-rust-c-ffi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anzhi0708/example-rust-c-ffi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzhi0708%2Fexample-rust-c-ffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzhi0708%2Fexample-rust-c-ffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzhi0708%2Fexample-rust-c-ffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzhi0708%2Fexample-rust-c-ffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anzhi0708","download_url":"https://codeload.github.com/anzhi0708/example-rust-c-ffi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzhi0708%2Fexample-rust-c-ffi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32660276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","build-system","c","cargo","clang","example","examples","examples-rust","ffi","foreign-function-interface","rust","std","stdlib"],"created_at":"2025-10-25T16:56:05.541Z","updated_at":"2026-05-05T17:32:42.046Z","avatar_url":"https://github.com/anzhi0708.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimal Rust C FFI example\n\n## Keypoints\n- Add `build = \"src/build.rs\"` in `Cargo.toml` (otherwise cargo sometimes fails to pick it up and I don't know why)\n- `#[link(name = \"hello\", kind = \"dylib\")]` (or another kind; in this case a dylib)\n- `cargo:rustc-link-search` flag in `build.rs` file\n- Set environment variables correctly (Linux: `LD_LIBRARY_PATH`, Mac: `DYLD_LIBRARY_PATH`)\n\n`build_and_run` bash script sets enviroment variables for you; you may want to take a look at it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzhi0708%2Fexample-rust-c-ffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanzhi0708%2Fexample-rust-c-ffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzhi0708%2Fexample-rust-c-ffi/lists"}