windows下openssl编译
昨晚,在编译rabbitmq-c时,使用cmake生成vs项目文件时遇到下列错误:
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR) (Required is at least version "0.9.8")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.6/Modules/FindOpenSSL.cmake:380 (find_package_handle_standard_args)
CMakeLists.txt:273 (find_package)
经查,需要源码安装openssl以及需要相关头文件(为了简单起见,用过直接下载二进制版,不行)。故下载openssl 0.9.8g进行编译。
首先确保安装ActivePerl。
1、perl Configure VC-WIN32 no-asm
必须指定no-asm,不然后边很多编译会报错,指定--prefix=E:\openssl可以安装到相应的目录。
2、ms\do_nasm.bat
ms子目录下生成nt.make和ntdll.make文件,由于指定了no-asm,所以在这里必须是do_nasm而不是do_ms。
3、nmake -f ms\ntdll.mak
4、nmake -f ms\ntdll.mak install #安装到prefix指定的目录
Microsoft (R) 程序维护实用工具 11.00.50727.1 版
版权所有 (C) Microsoft Corporation。保留所有权利。
Building OpenSSL
perl util/mkdir-p.pl E:\openssl
perl util/mkdir-p.pl E:\openssl\bin
created directory `E:/openssl/bin'
perl util/mkdir-p.pl E:\openssl\include
created directory `E:/openssl/include'
perl util/mkdir-p.pl E:\openssl\include\openssl
created directory `E:/openssl/include/openssl'
perl util/mkdir-p.pl E:\openssl\lib
created directory `E:/openssl/lib'
perl util/copy.pl inc32\openssl\*.[ch] E:\openssl\include\openssl
Copying: inc32/openssl/aes.h to E:/openssl/include/openssl/aes.h
Copying: inc32/openssl/applink.c to E:/openssl/include/openssl/applink.c
Copying: inc32/openssl/asn1.h to E:/openssl/include/openssl/asn1.h
Copying: inc32/openssl/asn1_mac.h to E:/openssl/include/openssl/asn1_mac.h
Copying: inc32/openssl/asn1t.h to E:/openssl/include/openssl/asn1t.h
Copying: inc32/openssl/bio.h to E:/openssl/include/openssl/bio.h
Copying: inc32/openssl/blowfish.h to E:/openssl/include/openssl/blowfish.h
Copying: inc32/openssl/bn.h to E:/openssl/include/openssl/bn.h
Copying: inc32/openssl/buffer.h to E:/openssl/include/openssl/buffer.h
Copying: inc32/openssl/cast.h to E:/openssl/include/openssl/cast.h
Copying: inc32/openssl/comp.h to E:/openssl/include/openssl/comp.h
Copying: inc32/openssl/conf.h to E:/openssl/include/openssl/conf.h
Copying: inc32/openssl/conf_api.h to E:/openssl/include/openssl/conf_api.h
Copying: inc32/openssl/crypto.h to E:/openssl/include/openssl/crypto.h
Copying: inc32/openssl/des.h to E:/openssl/include/openssl/des.h
Copying: inc32/openssl/des_old.h to E:/openssl/include/openssl/des_old.h
Copying: inc32/openssl/dh.h to E:/openssl/include/openssl/dh.h
Copying: inc32/openssl/dsa.h to E:/openssl/include/openssl/dsa.h
Copying: inc32/openssl/dso.h to E:/openssl/include/openssl/dso.h
Copying: inc32/openssl/dtls1.h to E:/openssl/include/openssl/dtls1.h
Copying: inc32/openssl/e_os2.h to E:/openssl/include/openssl/e_os2.h
Copying: inc32/openssl/ebcdic.h to E:/openssl/include/openssl/ebcdic.h
Copying: inc32/openssl/ec.h to E:/openssl/include/openssl/ec.h
Copying: inc32/openssl/ecdh.h to E:/openssl/include/openssl/ecdh.h
Copying: inc32/openssl/ecdsa.h to E:/openssl/include/openssl/ecdsa.h
Copying: inc32/openssl/engine.h to E:/openssl/include/openssl/engine.h
Copying: inc32/openssl/err.h to E:/openssl/include/openssl/err.h
Copying: inc32/openssl/evp.h to E:/openssl/include/openssl/evp.h
Copying: inc32/openssl/hmac.h to E:/openssl/include/openssl/hmac.h
Copying: inc32/openssl/idea.h to E:/openssl/include/openssl/idea.h
Copying: inc32/openssl/krb5_asn.h to E:/openssl/include/openssl/krb5_asn.h
Copying: inc32/openssl/kssl.h to E:/openssl/include/openssl/kssl.h
Copying: inc32/openssl/lhash.h to E:/openssl/include/openssl/lhash.h
Copying: inc32/openssl/md2.h to E:/openssl/include/openssl/md2.h
Copying: inc32/openssl/md4.h to E:/openssl/include/openssl/md4.h
Copying: inc32/openssl/md5.h to E:/openssl/include/openssl/md5.h
Copying: inc32/openssl/obj_mac.h to E:/openssl/include/openssl/obj_mac.h
Copying: inc32/openssl/objects.h to E:/openssl/include/openssl/objects.h
Copying: inc32/openssl/ocsp.h to E:/openssl/include/openssl/ocsp.h
Copying: inc32/openssl/opensslconf.h to E:/openssl/include/openssl/opensslconf.h
Copying: inc32/openssl/opensslv.h to E:/openssl/include/openssl/opensslv.h
Copying: inc32/openssl/ossl_typ.h to E:/openssl/include/openssl/ossl_typ.h
Copying: inc32/openssl/pem.h to E:/openssl/include/openssl/pem.h
Copying: inc32/openssl/pem2.h to E:/openssl/include/openssl/pem2.h
Copying: inc32/openssl/pkcs12.h to E:/openssl/include/openssl/pkcs12.h
Copying: inc32/openssl/pkcs7.h to E:/openssl/include/openssl/pkcs7.h
Copying: inc32/openssl/pq_compat.h to E:/openssl/include/openssl/pq_compat.h
Copying: inc32/openssl/pqueue.h to E:/openssl/include/openssl/pqueue.h
Copying: inc32/openssl/rand.h to E:/openssl/include/openssl/rand.h
Copying: inc32/openssl/rc2.h to E:/openssl/include/openssl/rc2.h
Copying: inc32/openssl/rc4.h to E:/openssl/include/openssl/rc4.h
Copying: inc32/openssl/ripemd.h to E:/openssl/include/openssl/ripemd.h
Copying: inc32/openssl/rsa.h to E:/openssl/include/openssl/rsa.h
Copying: inc32/openssl/safestack.h to E:/openssl/include/openssl/safestack.h
Copying: inc32/openssl/sha.h to E:/openssl/include/openssl/sha.h
Copying: inc32/openssl/ssl.h to E:/openssl/include/openssl/ssl.h
Copying: inc32/openssl/ssl2.h to E:/openssl/include/openssl/ssl2.h
Copying: inc32/openssl/ssl23.h to E:/openssl/include/openssl/ssl23.h
Copying: inc32/openssl/ssl3.h to E:/openssl/include/openssl/ssl3.h
Copying: inc32/openssl/stack.h to E:/openssl/include/openssl/stack.h
Copying: inc32/openssl/store.h to E:/openssl/include/openssl/store.h
Copying: inc32/openssl/symhacks.h to E:/openssl/include/openssl/symhacks.h
Copying: inc32/openssl/tls1.h to E:/openssl/include/openssl/tls1.h
Copying: inc32/openssl/tmdiff.h to E:/openssl/include/openssl/tmdiff.h
Copying: inc32/openssl/txt_db.h to E:/openssl/include/openssl/txt_db.h
Copying: inc32/openssl/ui.h to E:/openssl/include/openssl/ui.h
Copying: inc32/openssl/ui_compat.h to E:/openssl/include/openssl/ui_compat.h
Copying: inc32/openssl/x509.h to E:/openssl/include/openssl/x509.h
Copying: inc32/openssl/x509_vfy.h to E:/openssl/include/openssl/x509_vfy.h
Copying: inc32/openssl/x509v3.h to E:/openssl/include/openssl/x509v3.h
perl util/copy.pl out32dll\openssl.exe E:\openssl\bin
Copying: out32dll/openssl.exe to E:/openssl/bin/openssl.exe
perl util/copy.pl apps\openssl.cnf E:\openssl
Copying: apps/openssl.cnf to E:/openssl/openssl.cnf
perl util/copy.pl out32dll\ssleay32.dll E:\openssl\bin
Copying: out32dll/ssleay32.dll to E:/openssl/bin/ssleay32.dll
perl util/copy.pl out32dll\libeay32.dll E:\openssl\bin
Copying: out32dll/libeay32.dll to E:/openssl/bin/libeay32.dll
perl util/copy.pl out32dll\ssleay32.lib E:\openssl\lib
Copying: out32dll/ssleay32.lib to E:/openssl/lib/ssleay32.lib
perl util/copy.pl out32dll\libeay32.lib E:\openssl\lib
Copying: out32dll/libeay32.lib to E:/openssl/lib/libeay32.lib
生成的动态和静态库名为:libeay32.dll,libeay32.lib,ssleay32.dll,ssleay32.lib,以及openssl.exe。
相关错误:
第三步如果报:
.\crypto\cversion.c(105) : error C2220: 警告被视为错误 - 没有生成“object”文件
.\crypto\cversion.c(105) : warning C4129: “o”: 不可识别的字符转义序列
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"”: 返回代码“0x2”
Stop.
则打开ms\ntdll.mak文件,将其中的/WX去掉,如下:
如果报:
f:\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : error C2220: warning treated as error - no 'object' file generated
f:\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : warning C4005: 'EADDRINUSE' : macro redefinition
tmp32dll\e_os.h(153) : see previous definition of 'EADDRINUSE'
NMAKE : fatal error U1077: '"f:\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.
则:.打开errno.h文件,找到第92行,注释掉#define EADDRINUSE 100
如果报'nmake' 不是内部或外部命令,也不是可运行的程序或批处理文件,则使用VS自带的cmd,如下:
参考:
http://blog.csdn.net/eclipser1987/article/details/17588041
http://www.cnblogs.com/yidev/p/6373283.html
http://blog.163.com/lvan100@yeah/blog/static/68117214201332761143157/
http://shikezhi.com/html/2016/windows_0608/1140879.html
http://blog.csdn.net/pony_maggie/article/details/8588888
http://www.cnblogs.com/yidev/p/6373283.html
https://www.openssl.org/source/old/0.9.x/
http://blog.csdn.net/lg1259156776/article/details/52529704
至于其他的很多,纯属瞎扯淡。
windows下openssl编译的更多相关文章
- windows下rabbitmq-c编译(带openssl、无需MinGW)
因为项目原因,需要使用到rabbitmq的c客户端库.首先,参见上一篇windows下openssl编译,如果已经使用cmake编译过了,则先delete cache(File-Delete Cach ...
- Windows下openssl的下载安装和使用
Windows下openssl的下载安装和使用 安装openssl有两种方式,第一种直接下载安装包,装上就可运行:第二种可以自己下载源码,自己编译.下面对两种方式均进行详细描述. 一.下载和安装ope ...
- 原创 C++应用程序在Windows下的编译、链接:第一部分 概述
本文是对C++应用程序在Windows下的编译.链接的深入理解和分析,文章的目录如下: 我们先看第一章概述部分. 1概述 1.1编译工具简介 cl.exe是windows平台下的编译器,link.ex ...
- 【FFmpeg】Windows下FFmpeg编译
由于FFmpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译,需要在Windows下配置一个类 ...
- C++应用程序在Windows下的编译、链接(一)概述
C++应用程序在Windows下的编译.链接(一)概述 本文是对C++应用程序在Windows下的编译.链接的深入理解和分析,文章的目录如下: 我们先看第一章概述部分. 1概述 1.1编译工具简介 c ...
- ACE在windows下的编译及配置(VS2010)
ACE在windows下的编译及配置(VS2010) 分类: -[小西南]- 2013-08-06 16:17 2354人阅读 评论( ...
- [转]QGis2.9在windows下的编译以及二次开发包下载
今天心血来潮,将QGis在github上的代码更新后,又编译了一下.留意到源代码包里面的INSTALL文件有更新,于是本次编译完全基于官方的编译说明.编译过程非常顺利,除了在CMake的第一次conf ...
- Windows下PythonQt编译(vs2015+Qt5.11.2+PythonQt 3.2)
后记: 由于自己low,没有下载罪行的python3.2导致编译上遇到种种问题,后文可以参考,建议看: <Windows7 VS2015 下编译 PythonQt3.2> https:// ...
- Windows下PythonQt编译(vs2015+Qt5.11.2+PythonQt 3.2)探索
时间:2018年10月20日 笔者最近在做Qt方面的开发工作,需用到脚本程序对程序内部进行扩展,就很自然的想到了PythonQt,下面介绍PythonQt在Windows下的的安装编译心得,水平有限, ...
随机推荐
- Redis:redis.conf配置
redis.conf配置: 配置主要分为几类:基础.快照.复制.安全.限制.详细日志.虚拟内存.高级配置.文件包含 ##------------------------------------基础配置 ...
- ROSETTA使用技巧随笔--relax使用
Purpose: 主要说目的,relax的作用就是对一个给定的蛋白进行构象搜索,寻找与WT相似并能量低于WT的结构,既包含packer又包含minimizer.主要的应用在对一个结构构象进行取样,获得 ...
- Appium基础(四)查找app的appActivity与appPackage
要查看appActivity需要借助日志:adb logcat>D:/log.log 前提是已经装了Android SDK 在目录D:\Program Files (x86)\android\ ...
- 使用promisify解决fs的回调地狱问题
- Nginx配置文件具体配置解释
Nginx配置文件具体配置解释 #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processes 8; #全局错 ...
- gitlab覆盖率
https://danny50610.blogspot.com/2017/09/gitlab-ci-phpunit-coverage.html
- ruby自动化之selenium webGUI
1.下载ruby语言包,windows下需要安装rubyinstall http://railsinstaller.org/en 2.cmd命令下安装selenium-webdriver gem包 g ...
- 未能正确加载“EditorPackage”包(转)
打开vs2012加载项目的时候报如下的错误: 未能正确加载“Microsoft.VisualStudio.Editor.Implementation.EditorPackage”包.此问题可能是由配置 ...
- 从windows本地IDE启动远程Linux文件进行调试
1) 因为WingIDE调用putty和plink进行ssh连接,需要先设置putty. 点击下载putty,并解压,把解压路径附到操作系统PATH环境变量中,之后重新启动WingIDE,让它重新读 ...
- [DeploymentService:290066]Error occurred while downloading files from admin server for deployment request "0". Underlying error is: "null"
weblogic 莫名无法启动: <Apr , :: PM CST> <Error> <Deployer> <BEA-> <Failed to i ...