如何使用 Visual Studio 2017 在 Windows 上构建 OpenSSL? [英] How to build OpenSSL on Windows with Visual Studio 2017?

查看:20
本文介绍了如何使用 Visual Studio 2017 在 Windows 上构建 OpenSSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 OpenSSL,但我被困在编译步骤中.OpenSSL 项目的文档非常不友好(糟糕).

I am trying to use OpenSSL but I am stuck on the step of compiling. The OpenSSL project has very unfriendly (bad) documentation.

是否有任何实际帮助如何使用 Visual Studio 2017 在 Windows 上构建最新的 OpenSSL 版本?

Is there any actual help how to build the latest OpenSSL version on Windows with Visual Studio 2017?

我在 OpenSSL 官方网站上没有找到任何有用的信息.是的,网上有很多关于 OpenSSL 编译的帖子,但都已经过时了.

I didn't find any helpful information on the official OpenSSL site. Yes, there are a lot of posts on the Internet about OpenSSL compilation, but all of them are obsolete.

推荐答案

我没用过 VS2017,但以前的版本.我想它是一样的.请注意,以下说明适用于 OpenSSL 1.1.0 或更高版本.它们不适用于 OpenSSL 1.0.2.简要的步骤是:

I've not used VS2017 but previous versions. I imagine it is much the same. Note the instructions below are for OpenSSL 1.1.0 or above. They do not work for OpenSSL 1.0.2. In brief the steps are:

  1. 安装 Perl(ActiveState 或 Strawberry)

  1. 安装 NASM

  1. Install NASM

确保 Perl 和 NASM 都在您的 %PATH%

Make sure both Perl and NASM are on your %PATH%

使用管理权限启动 Visual Studio 开发人员命令提示符(如果您正在构建 32 位 OpenSSL,请确保使用 32 位,如果您正在构建 64 位 OpenSSL,请确保使用 64 位))

Fire up a Visual Studio Developer Command Prompt with administrative privileges (make sure you use the 32-bit one if you are building 32-bit OpenSSL, or the 64-bit one if you are building 64-bit OpenSSL)

从 OpenSSL 源目录的根目录输入 perl Configure VC-WIN32,如果你想要 32 位 OpenSSL 或 perl Configure VC-WIN64A 如果你想要 64 位 OpenSSL

From the root of the OpenSSL source directory enter perl Configure VC-WIN32, if you want 32-bit OpenSSL or perl Configure VC-WIN64A if you want 64-bit OpenSSL

输入nmake

进入nmake test

输入nmake install

如果任何阶段出现问题,请检查INSTALL文件和 NOTES.WIN 文件.

If anything goes wrong at any stage, check the INSTALL file and the NOTES.WIN file.

这篇关于如何使用 Visual Studio 2017 在 Windows 上构建 OpenSSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆