vs2019编译openssl1.1.1b

 

一、系统环境

   win7 64位

   vs2019社区版本

 二、准备下载以下内容

    1、openssl  此时最新版 https://www.openssl.org/source/openssl-1.1.1b.tar.gz

    2、Perl 64位和32位版本 都安装上吧

http://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-64bit.msi

http://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-32bit.msi

   3、nasm 这个64位和32位版本 看需要吧,可选安装。

       https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/win32/
       https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/win64/

 

三、准备开始编译啦!

1、先编译个64位版本吧( 默认是release版)

    (1-1)、以管理员方式启动  点击开始菜单启动 x86_x64 Cross Tools Command Prompt for VS 2019  

                  或者直接用cmd 命令cd到 这个目录 (实际是运行这东东 vcvarsx86_amd64.bat)

                  e:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat

                 

   (1-2)cd到openssl目录下依次执行

           

          第一步、 Perl Configure VC-WIN64A no-asm --prefix ={d:\openssl_bin}

          第二步、nmake         (编译)

           第三步、nmake test  (执行一些测试代码)

           第四步、nmake  install  将编译好的文件拷贝到 d:\openssl_bin

      附编译好的效果图

         

2、编译32位版本的,vs2015 2017 2019有个兼容工具 比较坑,所以启动命令行的时候要注意!!否则编译出错的!!!

   1)、 (vcvarsamd64_x86.bat)在开始菜单中 启动 x64_x86 Cross Tools Command Prompt for VS 2019

    或者命令行直接启动 e:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat

        

         第一步、 Perl Configure VC-WIN32 no-asm --prefix ={d:\openssl_bin}

          第二步、nmake         (编译)

           第三步、nmake test  (执行一些测试代码)

           第四步、nmake  install  将编译好的文件拷贝到 d:\openssl_bin

新版本的openssl编译和旧版本的 openssl1.0.0.2还是有区别的,将踩过的坑记下来备用吧

 其实openssl源码里面有个install文件,打开发现有说明,摘录一段里面的编译说明

   

Quick Start
 -----------

 If you want to just get on with it, do:

  on Unix (again, this includes Mac OS/X):

    $ ./config
    $ make
    $ make test
    $ make install

  on OpenVMS:

    $ @config
    $ mms
    $ mms test
    $ mms install

  on Windows (only pick one of the targets for configuration):

    $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
    $ nmake
    $ nmake test
    $ nmake install

 If any of these steps fails, see section Installation in Detail below.

 This will build and install OpenSSL in the default location, which is:

  Unix:    normal installation directories under /usr/local
  OpenVMS: SYS$COMMON:[OPENSSL-'version'...], where 'version' is the
           OpenSSL version number with underscores instead of periods.
  Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL

 

  • 6
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值