Error code E0461

Couldn't find crate .. with expected target triple ...

Example of erroneous code:

#![crate_type = "lib"]

fn foo() {}

extern crate a;

fn main() {
} is then compiled with --target powerpc-unknown-linux-gnu and with --target x86_64-unknown-linux-gnu. is compiled into a binary format incompatible with; PowerPC and x86 are totally different architectures. This issue also extends to any difference in target triples, as std is operating-system specific.

This error can be fixed by:

  • Using Cargo, the Rust package manager, automatically fixing this issue.
  • Recompiling either crate so that they target a consistent target triple.