場景
VS2015編譯openssl-1.1.1-pre1
甘孜州ssl適用于網站、小程序/APP、API接口等需要進行數據傳輸應用場景,ssl證書未來市場廣闊!成為創新互聯的ssl證書銷售渠道,可以享受市場價格4-6折優惠!如果有意向歡迎電話聯系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!
工具
nasm-2.14rc0-installer-x64.exe
ActivePerl-5.24.3.2404-MSWin32-x64-404865.exe
openssl-1.1.1-pre1.tar.gz
環境變量
C:\Program Files\NASM(添加匯編器路徑)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin(VS2015編譯路徑)
操作
1)perl Configure VC-WIN32 [no-shared] [no-asm] [no-tests] [--debug] --prefix=d:\openssllib
VC-WIN32:可根據需要修改為64位等,no-shared為編譯靜態庫,不加此項默認編譯出的是動態庫;no-tests為不需要tests功能,如果只需要openssl的庫可以加上此項,否則可能會出很多錯誤導致編譯不過;--debug為編譯debug版,不加此項默認編譯出的是release版。
2)nmake,編譯通過后再nmake install就安裝到--prefix=指定的目錄了。
3)如果要編譯多個版本(release,debug),最好先nmake clean下,再重復第3步驟。
注意:
1.VS工程的運行時庫(Runtime Library)選擇應與編譯出的openssl庫匹配,尤其動態庫,否則可能編譯不過
2.需要使用靜態庫的時候,如果編譯不過,出現LNK2019等錯誤的時候,你可能還需要添加ws2_32.lib,crypt32.lib庫。
3.NASM匯編器沒有安裝出現如下錯誤
C:\Users\admin\Downloads\openssl-1.1.1-pre1>perl Configure VC-WIN32
Using implicit seed configuration
Configuring OpenSSL version 1.1.1-pre1 (0x10101001L) for VC-WIN32
NASM not found - please read INSTALL and NOTES.WIN for further details
4It looks like you don't have either nmake.exe or dmake.exe on your PATH錯誤解決方案
It looks like you don't have either nmake.exe or dmake.exe on your PATH,
so you will not be able to execute the commands from a Makefile. You can
install dmake.exe with the Perl Package Manager by running:
ppm install dmake
解決:執行ppm install dmake,安裝dmake。
說明:ppm是perl圖形化包管理工具,dmake是同GNU Make類似的工具,支持跨平臺
當前安裝VS2015,搜索到nmake.exe,然后執行vcvarsall.bat,并且添加了VS的nmake路徑到環境變量還是有問題