Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E1000: Link error

CodeCategoryStability
E1000Linker and targetPermanent

Explanation

E1000 reports a failure in the last stage of a compile: turning the generated objects, the embedded per-target Rue runtime archive, and any --link-archive inputs into an executable. One code covers the whole link step, and the message carries the specific failure — a symbol no linked archive defines, an archive that cannot be opened or parsed, a relocation the linker cannot apply, an invalid or empty embedded runtime archive, or a failure to spawn, wait on, or read the output of the external linker selected with --linker <command>. Rue links with its own internal linker by default, so most E1000 text comes from that linker rather than from a host toolchain; when a system linker is selected instead, its stderr is captured and forwarded verbatim inside the message. E1000 carries no source span, because the link step operates on objects rather than on source text and there is no expression to point at.

Likely cause

The common cause is an extern "C" foreign declaration (preview feature c_ffi) whose symbol nothing linked defines. The message names the symbol and lists everything searched — the bundled Rue runtime archive followed by each --link-archive <path> in the order given — so supply the archive that defines the symbol, or correct the symbol's spelling. A --link-archive path that cannot be opened, and an archive whose members cannot be parsed, report under the same code and name the path. When --linker <command> selects a system linker, the text quoted after linker '<command>' failed: is that linker's own stderr and states the real cause.

Examples

Foreign symbol nothing linked defines

Requires --preview c_ffi.

extern "C" {
    fn missing_symbol() -> i32;
}

fn main() -> i32 {
    checked { missing_symbol() }
}

Requires --preview c_ffi.

pub extern "C" fn answer() -> i32 {
    42
}

fn main() -> i32 {
    answer()
}

References