asynchronous - 使用异步Rust时,如何解决 “ld: can' t写入输出文件错误?

标签 asynchronous rust linker

当我尝试运行此代码时:

use exitfailure::ExitFailure;
use reqwest::Url;
use serde_derive::{Deserialize, Serialize};
use std::env;

#[derive(Serialize, Deserialize, Debug)]
struct Response {
    country: String,
    currency: String,
    exchange: String,
    ipo: String,
    marketCapitalization: u64,
    name: String,
    phone: String,
    shareOutstanding: f64,
    ticker: String,
    weburl: String,
    logo: String,
    finnhubIndustry: String,
}

impl Response {
    async fn get(symbol: &String, api_key: &String) -> Result<Self, ExitFailure> {
        let url = format!(
            "https://finnhub.io/api/v1/stock/profile2?symbol={}&token={}",
            symbol, api_key
        );

        let url = Url::parse(&*url)?;

        let res = reqwest::get(url).await?.json::<Response>().await.unwrap();

        Ok(res)
    }
}

#[tokio::main]
async fn main() {
    let api_key = "MY API KEY".to_string();
    let args: Vec<String> = env::args().collect();
    let mut symbol: String = "AAPL".to_string();

    if args.len() < 2 {
        println!("Since you didn't specify a company symbol, it has defaulted to AAPL.");
    } else {
        symbol = args[1].clone();
    }

    let res = Response::get(&symbol, &api_key).await.unwrap();

    println!("{:?}", res);
}
我收到此错误:
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.10mo1ylysnbx30r1.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.11psfznihv5kcpt5.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.12cwyz3lr8n62xe6.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.15gkihtyeynsn89b.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.18kfwmjml1egys79.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.19069cpw4xioyqaq.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.19ci2bp7vs4vweme.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.19x56kjkzulfi8fw.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1a3v8zswvg7g9a6w.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1guv6nt7mmrkxibv.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1kt6qxx22434tbc3.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1l7jorrm73wibt2v.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1n7c4c2u1wywf5dd.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1rwo9tuexn66desw.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1tnbnxcigfmkql8x.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1vixco7pd6qfrcv5.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.1ybm5w7v3voya00w.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.20mvabhmvhg77gq9.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.232k1rqj2f2wwdez.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.25ibp25o2si3drd9.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.27x60hfbet0wakyr.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2ahfhpmt8wg5ngge.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2ezfkkr0y86tm9s6.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2fpx4n4ka04ajz24.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2frffw4fli1o2kn.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2hmdjyhd0622wfp8.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2jmgh0ouhyc9cv56.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2ltt979w5t12u3l6.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2m2ttfqxj1pvqzz6.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2rimkrb7fhsr9jbg.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2ruwff2lhjmg7jyc.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2rvd08vmb1quhho1.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2syn1ukgsyhjme63.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2vzlw0m13zeazijs.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2w33nguijliaz68v.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.2zpgyi08ea3pe0o0.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.314e72an9b4shxld.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.375avl2w9wrys3nw.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.391dy5s8m3oh8nvm.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3iuj4yuq16p6vtub.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3iw25q4czf19lll3.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3k88za3gq9ond25o.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3ox3r8xpoget2m2t.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3pe7abvrw8ea8b2a.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3sdjzmm2gv0p2sek.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3tdb1gwg7c08oxy5.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.3uf3uf3cfe1io01j.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.40naox5lts2r3n5c.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.41qimcw5us5ky6la.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.48ctwyz6bzbn4h6k.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4al2m8wc7o349ur8.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4avghvv2wu388sk8.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4dmbwprd8695xc13.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4ds4rnb20tlz5pn7.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4f2mdmrs0nyiyeq8.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4fmpwmq6qypzca6p.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4fzgpvecyx6ja8i8.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4h6ythmsabkq6gn4.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4hu7u16tmbsuu9ss.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4jvl2teek9p8xyw7.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4pqzfy5338v13vbd.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4uxieqmcaoih1jhg.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.4z6dt6vdmbm2d7dt.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.532gybpwufx8sigq.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.597v00yax2xybi4l.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.5eewt6pzz54oixxl.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.8i9prcx51f3cgql.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.dkstt1eye2cbgw0.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.fd57vw8wcety7mq.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.hrwxsfni2loo5ex.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.k8xnnkk5u9yrby6.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.kr60gvhcux3t2ve.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.m82dc9acvhu7o6x.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.pwgqkx6gkw3tc3o.rcgu.o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.r0qr1purb8cfmeg.rcgu.o" "-o" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli.yrkse78lxrxc10q.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps" "-L" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libreqwest-d47fdbf606bf620a.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhyper_tls-5a3af54a8ffb180c.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libserde_urlencoded-c10151ff206b13c5.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libipnet-b6af2892e698f28c.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtokio_native_tls-86ac5fc6e63ddcd7.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libmime-4fa1948e8c52a215.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libencoding_rs-d4e0a526a6abe8dc.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libserde_json-61073d6b0453cc13.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libryu-4636ec5641c33604.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libserde-30c4834a7ba13f49.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libbase64-6311ec00b7b3977f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libnative_tls-e831c23a19777a24.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtempfile-1f7aec72614c9930.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/librand-b9331825cb633ee3.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/librand_chacha-b9bcfc7c8b9bcb08.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libppv_lite86-e7bf5096a91c4751.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/librand_core-c29ef7f7cfaf6b02.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libgetrandom-5bb60aefce5e4801.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libremove_dir_all-716a99b6c1d63aa7.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libsecurity_framework-9e1e06214ab7fc52.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libbitflags-41b8f8950e56a876.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libsecurity_framework_sys-27c277ba47dd848b.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libcore_foundation-41cdcc1deb199bca.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libcore_foundation_sys-557b885c772a8e32.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhyper-f95bb67d6befc6f7.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libwant-b7636d9779f8727f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtry_lock-f238472f1838dc5c.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhttparse-3c9b38a1fd8d622d.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libsocket2-c1cec64eb994de4b.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libh2-01a690972fee58fc.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtracing_futures-83d06ef38dbe558d.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libpin_project-ad339fc190eeb9cd.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libindexmap-b7e44a71ecc17e2e.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhashbrown-db7623be31193963.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libslab-9813493f7fef3ecd.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtokio_util-5673c23897f89b08.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfutures_sink-dc2e5e4185470b0c.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtokio_stream-9cff9d7b4798d412.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libpin_project-204870f270c29c54.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtower_service-4bd2a220fb1e5714.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfutures_channel-a62baf4f9db1218b.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtracing-85d36ba68afc0971.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtracing_core-65ee00fa68b87299.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfutures_util-bdd3ded2645b8267.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfutures_task-7ab4b3497f3a9cbc.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libpin_utils-673785e039b7f638.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtokio-f74311cf5cb2e53f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libsignal_hook_registry-b0e4c82d53cdc7df.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libnum_cpus-079c11ca1f814fca.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libmemchr-559d3dd349824211.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libonce_cell-cffe5d12f7f421a4.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libmio-fd0b7fbf4694950f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libparking_lot-aa2a80500120f169.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libparking_lot_core-9d27d5bea102c2aa.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libsmallvec-588b05741d127581.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/liblock_api-f42225e558f5412f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libscopeguard-945b5af7db670d6f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libinstant-12cf3715f2740aec.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libpin_project_lite-03aad81e1c1e30cc.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhttp_body-ba7b7892cbb488d9.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/liblog-8e74e7fec1489f04.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libcfg_if-50ed2fa15d067a29.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfutures_core-edb92ed386cf8466.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/liblazy_static-9ef0ede18009bf0a.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/liburl-41e044cb55038e5e.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libidna-f8d3d56d7d21d3bd.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libunicode_normalization-0852fcd732238eec.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtinyvec-d64785aece862e86.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libtinyvec_macros-b02a76277ea4733d.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libunicode_bidi-dc483d502d46337f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libform_urlencoded-fd968e8a9d524113.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libpercent_encoding-d4d009468ba9ba6b.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libmatches-53ac052287761282.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libhttp-f4161afb4e31f886.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libitoa-ebc28a1bf7410a52.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libbytes-7841c7134013b4c4.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfnv-c2f60708f70b5b57.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libexitfailure-5e7c15540145d300.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libfailure-53a6839ae6a049f1.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libbacktrace-2b54a6b9210710b4.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libobject-ddbaedccfb53acb1.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/liblibc-94b18fa663f7969f.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libaddr2line-65af433140c2de69.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libgimli-6253e042934d6e4b.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/libcfg_if-5440abaea1237bb7.rlib" "/Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/librustc_demangle-cdf225f35af12fbf.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-518979da66993550.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-f52081aedccc205f.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-bad1c02788187328.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-6375d8dbf53aee9d.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-0ea8539778b0c0ab.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-64f30c6d69babb18.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-e27428d997fd2532.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-f02467a76e5a8054.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-9536efad7116d828.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5ca171f6ec11d7a5.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-14b621861b38e51f.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-38f4a0c206512fa5.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-99bca6ace58141c5.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-72a66f4c97a4c0c8.rlib" "/Users/henryboisdequin/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-e7cd9f0beed2fc0f.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: ld: can't write output file: /Users/henryboisdequin/Desktop/stock-cli/target/debug/deps/stock_cli for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error; 3 warnings emitted

error: could not compile `stock-cli`
一些有用的信息:
我在Mac上运行Rust的稳定版本。此问题从此以后再也没有发生过。

最佳答案

我通过在项目目录中运行sudo cargo clean来解决此问题。现在,我有不同的错误。

关于asynchronous - 使用异步Rust时,如何解决 “ld: can' t写入输出文件错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65746642/

相关文章:

Angular - 如何正确测试在 Observable 订阅 block 中执行的操作?

c# - Task.WhenAny ContinueWith : Get argument?

c++ - 使用异步boost asio代码进行同步操作

rust - 如何在 Rust 中迭代数组时更改数组中的值

rust - 如何解锁 future 的线程并返回结果

sockets - 循环中匹配臂中的变量来自哪里?

c - 使用 OpenFlow 构建/链接 ns3 网络模拟器时出错

c++ - 为什么主可执行文件和 dlopen 加载的共享库共享一个命名空间静态变量的拷贝?

c++ - 当设置中/MT 时程序可以运行,但当/MD 时程序会失败

c# - Task.WaitAll 不等待其他异步方法