How do I fix the error “couldn't load codegen backend” on macOS?


#1

main.rs:

fn main() {
    println!("Hello world!");
}
$ rustc main.rs:
error: couldn't load codegen backend "/usr/local/lib/rustlib/i686-apple-darwin/codegen-backends/librustc_codegen_llvm-llvm.dylib": "dlsym(RTLD_DEFAULT, CFURLConnectionCreateWithProperties): symbol not found"

I’m using macOS(10.11.6) with Rust 1.30.1 and gcc Apple LLVM version 8.0.0 (clang-800.0.42.1) .


#2

If somebody wants some sweet SO reputation: