Shared library build not exporting symbols


Hi, guys. First post. :slight_smile:

I’m trying out Rust (1.25.0), and I’ve created a super-simple Cargo project. It’s a library project, and I’ve updated my Cargo.toml to include the following at the end:

name = "say_hello"
crate-type = [“cdylib”]

So that it produces a Windows shared library file. The project has a single module, called “”, which looks like this:

pub extern “C” fn say_hello()
println!(“Hello, world!”);

I build the project using “cargo build --release”, and my “say_hello.dll” file is created. However, when I use dumpbin to list the exported symbol in the shared library, I see none (except something called “rust_eh_personality”).

I’m expecting to see the “say_hello” symbol listed in the exports of the the shared library. Am I doing something wrong here?


Make sure the say_hello module is public.

In your

pub mod say_hello;


Thanks! That was exactly the issue.

The docs for Rust really don’t make that very clear.