Linking Error on static lib build - LINK : fatal error LNK1181: cannot open input file 'jwt_lib.dll.libkernel32.lib'

I created a static lib (jwt_lib) an exported some functions, however, when linking to the .lib on windows I get the following error:

LINK : fatal error LNK1181: cannot open input file 'jwt_lib.dll.libkernel32.lib'

Cargo file-
[package]
name = "jwt_lib"
version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["staticlib","lib"]

[dependencies]
reqwest = { version = "0.12", features = ["json", "default-tls", "blocking"], default-features = false }
jsonwebtoken = { version="9.2.0" }
log = { version="0.4.29", features = ["std", "serde"] }
anyhow = {version="1.0.100"}
serde = { version="1.0.228" }
serde_json = { version="1.0.149"}

How are you trying to link to the static library?

Could be something else funky, but this really looks like a missing space between a jwt_lib.dll.lib and the standard Windows kernel32.lib library. Do you have a build.rs script?

1 Like