• Windows编译安装openssl


    本文链接:https://www.cnblogs.com/obarong/p/13260321.html

    官方不发布二进制文件,要下载源码编译

    环境

    Win10 64位
    VS2017
    openssl 1.1.1g
    nasm-2.15.02
    strawberry-perl-5.30.2.1-64bit
    CPU:Intel

    方法一

    下载编译好的openssl

    http://slproweb.com/products/Win32OpenSSL.html

    一般Light版本够用了。

    方法二

    下载源码,官方地址:
    https://www.openssl.org/source/

    解压,到源码目录,查看INSTALL

    下载perl:

    安装完会自动添加环境变量。

    下载nasm并添加环境变量,官方地址: https://www.nasm.us/

    用管理员打开“适用于 VS 2017 的 x64 本机工具命令提示”,到openssl源码目录

    d:
    cd D:projectswinopenssl-1.1.1g
    perl Configure VC-WIN64A
    nmake
    nmake test
    nmake install
    

    默认安装到C:Program FilesOpenSSL

    安装成功

    PS C:Program FilesOpenSSLin> openssl version
    OpenSSL 1.1.1g  21 Apr 2020
    

    参考

    Windows 下OpenSSL安装过程及错误解决办法_发呆的程序猿-CSDN博客_openssl安装教程
    https://blog.csdn.net/xuebing1995/article/details/80004638?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight

    OpenSSL 在windows系统下的编译全解_danscort2000的专栏-CSDN博客_openssl 编译
    https://blog.csdn.net/danscort2000/article/details/81300248

    问题

    • 用Git的perl,初始化报错
    $ perl Configure VC-WIN64I
    Configuring OpenSSL version 1.1.1g (0x1010107fL) for VC-WIN64I
    Using os-specific seed configuration
    
    ******************************************************************************
    This perl implementation doesn't produce Windows like paths (with backward
    slash directory separators).  Please use an implementation that matches your
    building platform.
    
    This Perl version: 5.26.2 for x86_64-msys-thread-multi
    ******************************************************************************
    

    解:下载官方perl。

    • ActiveState Perl,用powershell编译报错
    > perl Configure VC-WIN64I
    Configuring OpenSSL version 1.1.1g (0x1010107fL) for VC-WIN64I
    Using os-specific seed configuration
    Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: D:/projects/win/openssl-1.1.1g/util/perl C:/Perl64/site/lib C:/Perl64/lib) at C:/Perl64/site/lib/ActivePerl/Config.pm line 400.
    Compilation failed in require at C:/Perl64/site/lib/ExtUtils/MakeMaker.pm line 9.
    BEGIN failed--compilation aborted at C:/Perl64/site/lib/ExtUtils/MakeMaker.pm line 9.
    Compilation failed in require at C:/Perl64/site/lib/IPC/Cmd.pm line 235.
    

    解:
    用Strawberry Perl。

    参考:PERL运行“Can't locate Win32/OLE.pm in INC”怎么解决_百度知道
    https://zhidao.baidu.com/question/875590807540601412.html

    • 添加nmake的路径到环境变量,报错
    > nmake
    
    Microsoft (R) 程序维护实用工具 14.16.27027.1 版
    版权所有 (C) Microsoft Corporation。  保留所有权利。
    
            "D:	oolStrawberryperlinperl.exe" "-I." -Mconfigdata "utildofile.pl"  "-omakefile" "includecrypton_conf.h.in" > includecrypton_conf.h
            "D:	oolStrawberryperlinperl.exe" "-I." -Mconfigdata "utildofile.pl"  "-omakefile" "includecryptodso_conf.h.in" > includecryptodso_conf.h
            "D:	oolStrawberryperlinperl.exe" "-I." -Mconfigdata "utildofile.pl"  "-omakefile" "includeopensslopensslconf.h.in" > includeopensslopensslconf.h
            "C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023inHostx64x64
    make.exe" /                   depend && "C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023inHostx64x64
    make.exe" /                   _all
    
    Microsoft (R) 程序维护实用工具 14.16.27027.1 版
    版权所有 (C) Microsoft Corporation。  保留所有权利。
    
    
    Microsoft (R) 程序维护实用工具 14.16.27027.1 版
    版权所有 (C) Microsoft Corporation。  保留所有权利。
    
            cl  /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_BN_ASM_MONT" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"AES_ASM" -D"GHASH_ASM" -D"OPENSSLDIR="C:\Program Files\Common Files\SSL"" -D"ENGINESDIR="C:\Program Files\OpenSSL\lib\engines-1_1"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"OPENSSL_USE_APPLINK" -D"NDEBUG"  -c /Foappsapp_rand.obj "appsapp_rand.c"
    app_rand.c
    D:projectswinopenssl-1.1.1ge_os.h(13): fatal error C1083: 无法打开包括文件: “limits.h”: No such file or directory
    NMAKE : fatal error U1077: “"C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023inHostx64x64cl.EXE"”: 返回代码“0x2”
    Stop.
    NMAKE : fatal error U1077: “"C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023inHostx64x64
    make.exe"”: 返回代码“0x2”
    Stop.
    

    解:
    使用“适用于 VS 2017 的 x64 本机工具命令提示”来编译。

    • nmake报错
    'ias' 不是内部或外部命令,也不是可运行的程序
    或批处理文件。
    NMAKE : fatal error U1077: “ias”: 返回代码“0x1”
    Stop.
    NMAKE : fatal error U1077: “"C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023inHostX64x64
    make.exe"”: 返回代码“0x2”
    Stop.
    

    解:

    perl Configure VC-WIN64A
    

    参考:[openssl-dev] [openssl.org #4630] Fatal error U1077: 'ias' : return code '0x1' on Skylake processor
    https://mta.openssl.org/pipermail/openssl-dev/2016-July/008090.html

  • 相关阅读:
    选项卡
    使用script创建标签添加属性值和添加样式
    判断表单不能为空(表格形式的)
    数组
    关于meta元信息元素
    js判断数据类型
    Ising模型的Metropolis模拟中的组态阻塞和振荡
    python 画能级图
    python 调用 shell 命令,制作用户界面
    打包 python 程序,变成一个可执行文件
  • 原文地址:https://www.cnblogs.com/obarong/p/13260321.html
Copyright © 2020-2023  润新知