Revision $Id: openssl-compile-msvs-mt.base,v 1.8 2011/03/10 23:35:18 klm Exp $ Purpose This recipe demonstrates how to build a static version of OpenSSL using Microsoft Visual Studio 8 and install it in C:\OpenSSL. Motivation When compiling WebJob, I prefer to link against statically compiled OpenSSL libraries. Since WebJob must be compiled as a multithreaded binary on WIN32 platforms, it is necessary to compile against a compatible set of OpenSSL libraries. Requirements Cooking with this recipe requires Microsoft Visual Studio 8 and Active Perl 5.8.8 (822) or higher. Note: Higher versions of Visual Studio have not been tested, so your results may vary. This recipe was last tested on openssl-0.9.8q. Solution The solution is verify that the CFLAG macro in nt.mak contains /MT prior to building OpenSSL. The following steps describe how to implement this solution. 1. Unpack OpenSSL tar ball. 2. Open a command window and run: cd VSVARS32.bat perl Configure VC-WIN32 --prefix=C:\OpenSSL ms\do_ms 3. Edit ms\nt.mak and verify that /MT (not /MD) is specified in the CFLAG macro. This causes OpenSSL to link against multi-threaded libraries. notepad ms\nt.mak 4. Compile with: nmake -f ms\nt.mak 5. Test with: cd out32 ..\ms\test 6. Install with: cd .. nmake -f ms\nt.mak install Closing Remarks Credits This recipe was brought to you by Klayton Monroe.