简体   繁体   中英

How to fix Terra Rust Smart Contract OpenSSL Error

I am on windows 11. When i run "cargo install cargo-generate --features vendored-openssl" in cmd or powershell i receive:

error: failed to run custom build command for `openssl-sys v0.9.72`

Caused by:
process didn't exit successfully: `C:\Users\tjblu\AppData\Local\Temp\cargo-installsZBq7g\release\build\openssl-sys-dce3228ef73e702e\build-script-main` (exit code: 101)
\--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
OPENSSL_NO_VENDOR unset
running "perl" "./Configure" "--prefix=C:\\Users\\tjblu\\AppData\\Local\\Temp\\cargo-installsZBq7g\\release\\build\\openssl-sys-5dd3ef493eeba8e5\\out\\openssl-build\\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"

\--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }', C:\\Users\\tjblu.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\openssl-src-111.18.0+1.1.1n\\src\\lib.rs:477:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-generate v0.13.0`, intermediate artifacts can be found at `C:\Users\tjblu\AppData\Local\Temp\cargo-installsZBq7g`

Caused by:
build failed

I've tried so many remedies, please help!

Tried installing perl, choco install openssl. Anything i could find online.

I have found a temporary workaround for this.

These are the steps I took:

  • Manually downloaded the 'cargo-generate' package from the following link: https://github.com/cargo-generate/cargo-generate/releases

  • Downloaded 'cargo-generate-v0.13.0-x86_64-pc-windows-msvc.tar.gz'

  • Extracted the content, and copied 'cargo-generate.exe' to the following Windows local directory path 'C:\Users\[username]\.cargo\bin\'.

Hope this helps for now, also waiting for a better solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM