Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows openssl compilation error #33

Open
triplewz opened this issue Jan 12, 2021 · 6 comments
Open

windows openssl compilation error #33

triplewz opened this issue Jan 12, 2021 · 6 comments
Labels
documentation Improvements or additions to documentation watch This issue is in watching

Comments

@triplewz
Copy link

你好,请问这个能在windows下编译吗,我编译的时候出现这个问题是怎么回事呢?

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

Caused by:
  process didn't exit successfully: `D:\rust\WeDPR-Lab-Core\target\debug\build\openssl-sys-9907d4d9e796620a\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=D:\\rust\\WeDPR-Lab-Core\\target\\debug\\build\\openssl-sys-d00d5dea42c1c716\\out\\openssl-build\\install" "no-dso" "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
@qyan-dev
Copy link
Contributor

It can be compiled on Windows, but you need to install openssl library first.

The easiest way is to install Strawberry Perl, which will include all the requried openssl dependences.

https://strawberryperl.com/

@qyan-dev qyan-dev added the documentation Improvements or additions to documentation label Jan 13, 2021
@qyan-dev qyan-dev changed the title windows编译问题 windows openssl compilation error Jan 13, 2021
@qyan-dev
Copy link
Contributor

It can be compiled on Windows, but you need to install openssl library first.

The easiest way is to install Strawberry Perl, which will include all the requried openssl dependences.

https://strawberryperl.com/

Some of features need openssl source code for cross compilation targeting other instruction set.

But for x86/x64, there is actually an easier way to install precompiled openssl from https://slproweb.com/products/Win32OpenSSL.html

  1. Please use the default install path.
  2. After installation, set system environment variable OPENSSL_DIR=C:\Program Files\OpenSSL-Win64

Then cargo build should work.

@triplewz
Copy link
Author

I have installed OPENSSL, and set system environment variable.
微信截图_20210114144229
But it did't work.

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

Caused by:
  process didn't exit successfully: `C:\Users\rust\WeDPR-Lab-Core\target\debug\build\openssl-sys-9907d4d9e796620a\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\\rust\\WeDPR-Lab-Core\\target\\debug\\build\\openssl-sys-d00d5dea42c1c716\\out\\openssl-build\\install" "no-dso" "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: "系统找不到指定的文件。" }', C:\Users\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\openssl-src-111.13.0+1.1.1i\src\lib.rs:413:39

@qyan-dev
Copy link
Contributor

Strange. Use openssl on Windows is complex :-)

Could you try to remove OPENSSL_INCLUDE_DIR and OPENSSL_LIB_DIR?

I only set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64 on my computer.

If it is still not working , just try installing the Strawberry Perl.

https://strawberryperl.com/

@qyan-dev qyan-dev added the watch This issue is in watching label Jan 18, 2021
@triplewz
Copy link
Author

I reinstalled OPENSSL, and built it successfully. Thanks!

@qyan-dev
Copy link
Contributor

Cool. Good to know this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation watch This issue is in watching
Projects
None yet
Development

No branches or pull requests

2 participants