Skip to content

Instantly share code, notes, and snippets.

@madsmtm
Created December 13, 2025 15:03
Show Gist options
  • Select an option

  • Save madsmtm/d8a876ebbf4f650918a374d6d86ff1ce to your computer and use it in GitHub Desktop.

Select an option

Save madsmtm/d8a876ebbf4f650918a374d6d86ff1ce to your computer and use it in GitHub Desktop.
Minimal cc-rs project that shows a linker warning about incorrect versions
fn main() {
cc::Build::new().file("foo.c").compile("foo");
}
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "cc"
version = "1.2.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215"
dependencies = [
"find-msvc-tools",
"shlex",
]
[[package]]
name = "cc-warning-minimal"
version = "0.1.0"
dependencies = [
"cc",
]
[[package]]
name = "find-msvc-tools"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[package]
name = "cc-warning-minimal"
version = "0.1.0"
edition = "2024"
[[bin]]
name = "cc-warning-minimal"
path = "main.rs"
[build-dependencies]
cc = "1.0"
[workspace]
void foo(void) {}
#![warn(linker_messages)]
unsafe extern "C" {
safe fn foo();
}
fn main() {
foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment