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

问题描述

在安装cargo install wasm-pack时编译失败,报错如下

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

Caused by:
  process didn't exit successfully: `xxx\openssl-sys-aaee31d2ea6e39db\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=xxx\\target\\debug\\build\\openssl-sys-fa02faf7b01ccae6\\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: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\xxx\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.16.0+1.1.1l\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: build failed

解决方式

安装per https://strawberryperl.com/

你可能感兴趣的:(问题合集,rust,react.js,css)