gpt4 book ai didi

windows - 错误: could not find native static library `ssl` ,也许缺少-L标志?在窗口上

转载 作者:行者123 更新时间:2023-12-03 11:48:03 27 4
gpt4 key购买 nike

我正在尝试在Windows上构建此项目。 -> https://github.com/alexanderbanks/rust-api
https://users.rust-lang.org/t/error-could-not-find-native-static-library-ssl-perhaps-an-l-flag-is-missing-on-windows/46777
当我运行 cargo build 时,出现以下错误。请注意,我已将依赖项更新为

[dependencies]
iron = "0.6.1"
router = "0.6.0"
time = "0.2.16"
serde = "1.0.114"
serde_derive = "1.0.114"
serde_json = "1.0.57"
diesel = { version = "1.4.5", features = ["postgres"] }
diesel_codegen = { version = "0.16.1", features = ["postgres"] }
dotenv = "0.15.0"
bcrypt = "0.8.1"
rand = "0.7.3"
bodyparser = "0.8.0"
frank_jwt = "3.1.2"
Windows路径
enter image description here
错误:
error: could not find native static library `ssl`, perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `openssl-sys`.

最佳答案

通过设法找到here,我设法使其运行。
在某处创建一个目录(使用C:\Tools),然后将cd放入其中并运行以下命令:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe install openssl:x64-windows-static
在我的计算机上运行大约需要15分钟。
完成后,您需要设置以下环境变量:
SET OPENSSL_DIR=C:\Tools\vcpkg\installed\x64-windows-static
SET OPENSSL_STATIC=Yes
完成所有操作后,将 cd返回到您的项目目录并运行cargo build;它现在应该可以工作。

关于windows - 错误: could not find native static library `ssl` ,也许缺少-L标志?在窗口上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63223387/

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