準備物
・Visual C++(Express 2012で説明します)
・Perl(ActivePerlあたりでもどうぞ)作業フォルダ
・c:\openssl
・c:\oepnssl\x86
・c:\openssl\x64
ソースのダウンロード
・OpenSSL公式(自分ときは1.0.1eでした)
32bit版の手順
「VS2012 x86 Native Tools コマンド プロンプト」を起動
cd c:\openssl\openssl-1.0.1e
perl Configure no-asm --prefix=..\x86 VC-WIN32
ms\do_ms.bat
nmake -f ms\ntdll.mak install
64bit版の手順
「VS2012 x64 Cross Tools コマンド プロンプト」を起動
cd c:\openssl\openssl-1.0.1e
perl Configure no-asm --prefix=..\x64 VC-WIN64A
ms\do_win64a.bat
nmake -f ms\ntdll.mak install
確認
c:\openssl\x86\binとc:\openssl\x64\binに
・libeay32.dll
・ssleay32.dll
が、できてればOK
クリーン
nmake -f ms\ntdll.mak clean
经过测试发现 这个方法也可以放在 vs2013 下使用, 另测试 nasm最新版本不能正常编译,已知可用 nasm 版本 nasm 2.11.02 。
说明:
下载ActivePerl
安装到最后的时候记得勾选那个添加到环境目录。
打开 开始菜单
的 Visual Studio 2013
–>Visual Studio Tools
,选择相应版本的控制台打开, 使用 cd \d
进入 vcvars32.bat
|| vcvars32.bat
所在的目录,运行。
默认目录
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat
解压 openssl 到xxx位置,之后的过程 和上述的 vs 2012
一样,这几句都比较简单不做翻译。
说明,编译错误后 一定要清理工程 重新开始。。否则会一直错。
另 x86 和 x64 最好解压两份 openssl 的源码出来,不确定是否会有混编问题
参考:
http://p-nand-q.com/programming/windows/building_openssl_with_visual_studio_2013.html
http://qiita.com/softgate/items/6628438777197854740f
http://relog.xii.jp/mt5r/2013/11/opensslwindows32bit64bit.html