Rust errors / Names, paths and imports
Rust compiler error · checked with rustc 1.99.0
Rust error E0454: link name must not be empty
What it meansA link name was given with an empty name.
What rustc prints
error[E0454]: link name must not be empty
--> main.rs:1:15
|
1 | #[link(name = "")] extern "C" {}
| ^^ empty link nameReal output of rustc 1.99.0 compiling the official example below (2021 edition). Your names and line numbers will differ; the first line is the part to match.
The compiler team's explanation
A link name was given with an empty name.
Erroneous code example:
#[link(name = "")] extern "C" {}
// error: `#[link(name = "")]` given with empty name
The rust compiler cannot link to an external library if you don't give it its name. Example:
#[link(name = "some_lib")] extern "C" {} // ok!From rustc --explain E0454 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
- E0425cannot find value in this scope
- E0603is private
- E0432unresolved import
- E0005refutable pattern in local binding
- E0451field `b` of struct `Foo` is private
- E0453allow(non_snake_case) incompatible with previous forbid
- E0459`#[link]` attribute requires a `name = "string"` argument
- E0460Found possibly newer version of crate `..` which `..` depends on
Up next
Often hit nextE0425: cannot find value in this scopeA related error from the same family.Read it next →Did this answer your question?