gpt4 book ai didi

gcc - 使用 Cargo 构建时找不到 `lcrypto` 或 `lssl`

转载 作者:行者123 更新时间:2023-11-29 08:30:24 26 4
gpt4 key购买 nike

Rust 和 Cargo 从 2014 年 12 月 30 日开始。海湾合作委员会 4.8.3。

我在项目目录中的 cargo run 上收到以下消息。

error: linking with `gcc` failed: exit code: 1
note: gcc '-Wl,--enable-long-section-names' '-fno-use-linker-plugin' '-Wl,--nxcompat' '-static-libgcc' '-m64' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib' '-o' 'D:\__start\rust-web-iron\target\rust-web-iron.exe' 'D:\__start\rust-web-iron\target\rust-web-iron.o' '-Wl,--gc-sections' 'D:\__start\rust-web-iron\target\deps\libiron-9458c3a7430cd345.rlib' 'D:\__start\rust-web-iron\target\deps\libmodifier-f18d612d13fb7b64.rlib' 'D:\__start\rust-web-iron\target\deps\libplugin-c932a4ffd97a9fec.rlib' 'D:\__start\rust-web-iron\target\deps\libphantom-3c95ed32bb19cc57.rlib' 'D:\__start\rust-web-iron\target\deps\libhyper-37211ade1c8dfef3.rlib' 'D:\__start\rust-web-iron\target\deps\libmucell-dcebaca45047164d.rlib' 'D:\__start\rust-web-iron\target\deps\libmime-15d27ce21969eec5.rlib' 'D:\__start\rust-web-iron\target\deps\libtypemap-c4ec45abe5f40a37.rlib' 'D:\__start\rust-web-iron\target\deps\libunsafe-any-ef1867dfe1b38a9e.rlib' 'D:\__start\rust-web-iron\target\deps\liblog-25f1bf92e34cdaf5.rlib' 'D:\__start\rust-web-iron\target\deps\libregex-2b8b3341ed7ceeb7.rlib' 'D:\__start\rust-web-iron\target\deps\liberror-14128451581aeed2.rlib' 'D:\__start\rust-web-iron\target\deps\libtypeable-680493e87963e405.rlib' 'D:\__start\rust-web-iron\target\deps\libcookie-e7b4e699158b9dc4.rlib' 'D:\__start\rust-web-iron\target\deps\libtime-82dafc95a42caa7e.rlib' 'D:\__start\rust-web-iron\target\deps\liburl-e9f12437efec5264.rlib' 'D:\__start\rust-web-iron\target\deps\libopenssl-79e6c3ab8827c788.rlib' 'D:\__start\rust-web-iron\target\deps\librustc-serialize-bd3e38505da47309.rlib' 'D:\__start\rust-web-iron\target\deps\libopenssl-sys-c071ba4e5034c35b.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libserialize-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liblog-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libregex-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libcollections-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liballoc-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liblibc-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\librand-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libunicode-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libcore-4e7c5e5c.rlib' '-L' 'D:\__start\rust-web-iron\target' '-L' 'D:\__start\rust-web-iron\target\deps' '-L' 'D:\__start\rust-web-iron\target\build\time-82dafc95a42caa7e\out' '-L' 'D:\__start\rust-web-iron\.rust' '-L' 'D:\__start\rust-web-iron' '-Wl,--whole-archive' '-Wl,-Bstatic' '-Wl,--no-whole-archive' '-Wl,-Bdynamic' '-lcrypto' '-lssl' '-lgdi32' '-lwsock32' '-lws2_32' '-lcompiler-rt'
note: ld: cannot find -lcrypto
ld: cannot find -lssl

error: aborting due to previous error
Could not compile `rust-web-iron`.

Caused by:
Process didn't exit successfully: `rustc D:\__start\rust-web-iron\src\main.rs --crate-name rust-web-iron --crate-type bin -g --out-dir D:\__start\rust-web-iron\target --emit=dep-info,link -L D:\__start\rust-web-iron\target -L D:\__start\rust-web-iron\target\deps --extern iron=D:\__start\rust-web-iron\target\deps/libiron-9458c3a7430cd345.rlib -L D:\__start\rust-web-iron\target\build\time-82dafc95a42caa7e\out` (status=101)

最佳答案

您正在使用依赖于 OpenSSL 的 crate 和 libcrypto .您必须下载、编译和安装 OpenSSL。由于您使用的是 Windows,因此您应该使用 MSYSMSYS2构建 OpenSSL。 MSYS2 有一个 OpenSSL 的包,所以安装起来应该比较容易。

关于gcc - 使用 Cargo 构建时找不到 `lcrypto` 或 `lssl`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27719250/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com