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"
我使用的是通过rustup安装了Rust1.30.1的macOS 10.11.6。Apple LLVM version 8.0.0 (clang-800.0.42.1)
新闻的gcc报道。
发布于 2019-05-23 03:45:36
我在x86上的Gentoo系统上也遇到过同样的问题。由于某些原因,codegen库被安装到
/usr/lib/rust-1.34.2/rust-1.34.2/rustlib/i686-unknown-linux-gnu/codegen-backends
注意重复的rust-1.34.2
目录。
我的解决方案是从预期的位置对目录进行符号链接;您必须使用root
权限执行此操作:
# cd /usr/lib/rust-1.34.2/rustlib/i686-unknown-linux-gnu/
# ln -s ../../rust-1.34.2/rustlib/i686-unknown-linux-gnu/codegen-backends .
在安装新版本的Rust时,您可能需要重复此操作。
https://stackoverflow.com/questions/53587933
复制相似问题