How do i use a C library when building with trunk-rs?

⚓ Rust    📅 2026-07-12    👤 surdeus    👁️ 1      

surdeus

How do integrate a C library, that uses libc when building with trunk?

Currently i am using cc crate to build for native (tested on windows). But i am unable to compile to wasm because stdlib.h is missing. I have asked AI but it told me to reimplement libc, which is the last thing i want to do. Is there any tool or step i could take to make this a bit easier.

Context:

  • Egui using the eframe template, should be able to build to both native and wasm

  • Cubiomes - this is the library i want to integrate

  • Walkers - for mapping the Minecraft world and generating custom tiles

2 posts - 2 participants

Read full topic

🏷️ Rust_feed