简体   繁体   English

无法运行“rustc”错误。 (生锈货物构建问题)

[英]Failed to run `rustc` error. (Rust cargo build issue)

Im trying to cargo build a file but have some issues.我试图建立一个文件,但有一些问题。

I set rustup nightly-x86_64-pc-windows-msvc default but still get the error.我将 rustup nightly-x86_64-pc-windows-msvc 设置为默认值,但仍然出现错误。

RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown

Error:错误:

error: failed to run `rustc` to learn about target-specific information

  Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names '-C link-arg=-s' --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: multiple input filenames provided (first two filenames are `-` and `'-C`)

Thanks for help and solutions感谢您的帮助和解决方案

If you're using cmd , try using the set command to set the environment variable.如果您使用的是cmd ,请尝试使用set命令设置环境变量。 You can also try using double-quotes ( " ) or no quotes.您也可以尝试使用双引号 ( " ) 或不使用引号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么此Rust 2018代码使用`cargo build`编译但不使用rustc编译? - Why does this Rust 2018 code compile with `cargo build` but not using rustc? 当rustc启用musc时,未能使用货物建立rust-libc - failure to build rust-libc using cargo when rustc is musl-enabled 在Xcode中使用NSTask在AppKit应用程序中运行时,Rust 1.4.0(或更高版本)货物/铁锈崩溃 - Rust 1.4.0 (or later) cargo/rustc crashes when run in an AppKit app using NSTask in Xcode 是否可以用稳定的 rustc 运行夜间货物 - Is it possible to run nightly cargo with stable rustc 在Windows上执行货物时rustc消失 - rustc disappears when executing cargo run on windows 如何仅使用rustc而不使用商品链接动态Rust库? - How to link a dynamic Rust library using only rustc and not cargo? 如何让 cargo/rustc 为 Rust 代码生成简洁的汇编语言? - How to have cargo/rustc generate concise assembly language for Rust code? 无法构建 dotenv v0.15.0 - rust 货物 - Failed to build dotenv v0.15.0 - rust cargo 在 Rust 中包装(动态链接的)C 库:适用于 rustc,不适用于 cargo - Wrapping a (dynamically-linked) C library in Rust: works with rustc, not with cargo 尝试使用 cargo build-bpf 构建 rust 项目时出错 - Error when trying to build rust project with cargo build-bpf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM