在vs2010下编译OpenSSL

Building OpenSSL for Visual Studio

Building OpenSSL for Visual Studio on Windows is mostly straight-forward, but it has some quirks. I’ll document the results of my wrestling here so that future attempts will be less painful.

What you need

You need to install…

Setting up for the build

Unzip3 the OpenSSL source code into two different folders, one for the 32-bit build and one for the 64-bit build4. So, for example, you might end up with C:\openssl-src-32 and C:\openssl-src-64.

Building the 32-bit static libraries

  1. Open the Visual Studio Command Prompt (2010)5.
  2. cd to your OpenSSL source folder for 32-bit (e.g. cd C:\openssl-src-32).
  3. Run the following: 6

Your outputs will be in C:\Build-OpenSSL-VC-32.

Building the 32-bit static libraries with debug symbols

These steps will embed the debug symbols directly into the .lib files. Don’t expect to see any .pdb files.

  1. Open the Visual Studio Command Prompt (2010).
  2. cd to your OpenSSL source folder for 32-bit (e.g. cd C:\openssl-src-32).
  3. Run the following:
  4. In a text editor (like Notepad), open ms\nt.mak and replace all occurrences of /Zi with /Z7. There should be three replacements.7
  5. Run the following:

Your outputs will be in C:\Build-OpenSSL-VC-32-dbg. Make sure you rename them to something likelibeay32-debug.lib and ssleay32-debug.lib.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值