Discussion:
Successfully building openssl-1.0.1 with Microsoft Visual Studio.
jeremy hunt
2012-03-23 07:53:58 UTC
Permalink
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions for Microsoft Visual Studio.

Summary:
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1


Details:
-------
I recently had to move my build machine to another PC, and I needed to
build OpenSSL 1.0.1.

I had installed MS Visual Studio 2005 on a Win XP system.

I followed the excellent build instructions in the INSTALL.W32 file. I
built from a Visual Studio 2005 Command Prompt window as I always do.
Unfortunately my first build failed in the link phase because it
couldn't find crypt32.lib.

On further investigation I found that crypt32.lib was in the Microsoft
SDK which I had to download and install on my build machine.

I trashed my build directory and unpacked a new one, so I could go
through the configure script with the installed SDK. I started a new
Visual Studio 2005 Command Prompt Window for the build. Unfortunately
the configure script did not find the SDK libraries and my build failed
in the same place.

So I manually modified the vsvars32.bat file that the "Visual Studio
Command Prompt" uses to load its environment variables. I added:
%Program Files%\Microsoft SDKs\Windows\7.0\Bin to PATH
%Program Files%\Microsoft SDKs\Windows\7.0\Include to INCLUDE
%Program Files%\Microsoft SDKs\Windows\7.0\Lib to LIB
(On my system this file can be found in %Program Files%\Microsoft Visual
Studio 8\Common7\Tools)

Again I trashed the build directory and unpacked a new one. I started a
new Visual Studio 2005 Command Prompt Window and went from the configure
phase right through to build and test. Everything worked beautifully.
All modules were built and all the tests passed successfully.

As I said, I hope this helps others and, if appropriate, the developers
might want to state the Microsoft SDK is a requirement for Visual Studio
builds.

Regards,

Jeremy
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Thomas J. Hruska
2012-03-23 15:04:34 UTC
Permalink
Post by jeremy hunt
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions for Microsoft Visual Studio.
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1
-------
I recently had to move my build machine to another PC, and I needed to
build OpenSSL 1.0.1.
I had installed MS Visual Studio 2005 on a Win XP system.
I followed the excellent build instructions in the INSTALL.W32 file. I
built from a Visual Studio 2005 Command Prompt window as I always do.
Unfortunately my first build failed in the link phase because it
couldn't find crypt32.lib.
On further investigation I found that crypt32.lib was in the Microsoft
SDK which I had to download and install on my build machine.
I trashed my build directory and unpacked a new one, so I could go
through the configure script with the installed SDK. I started a new
Visual Studio 2005 Command Prompt Window for the build. Unfortunately
the configure script did not find the SDK libraries and my build failed
in the same place.
So I manually modified the vsvars32.bat file that the "Visual Studio
%Program Files%\Microsoft SDKs\Windows\7.0\Bin to PATH
%Program Files%\Microsoft SDKs\Windows\7.0\Include to INCLUDE
%Program Files%\Microsoft SDKs\Windows\7.0\Lib to LIB
(On my system this file can be found in %Program Files%\Microsoft Visual
Studio 8\Common7\Tools)
Again I trashed the build directory and unpacked a new one. I started a
new Visual Studio 2005 Command Prompt Window and went from the configure
phase right through to build and test. Everything worked beautifully.
All modules were built and all the tests passed successfully.
As I said, I hope this helps others and, if appropriate, the developers
might want to state the Microsoft SDK is a requirement for Visual Studio
builds.
Regards,
Jeremy
If you had to do that, then your command line build environment on your
new machine was not set up correctly to begin with. Most modern
projects would probably not have built (not just OpenSSL). As a Windows
developer, the Windows SDK is an implied requirement for any project.
--
Thomas Hruska
Shining Light Productions

Home of BMP2AVI and Win32 OpenSSL.
http://www.slproweb.com/

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
jeremy hunt
2012-03-25 23:31:55 UTC
Permalink
Post by Thomas J. Hruska
Post by jeremy hunt
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions
for Microsoft Visual Studio.
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1
Details: (cut out for this reply, refer to my original posting if you
need help)
Regards,
Jeremy
If you had to do that, then your command line build environment on
your new machine was not set up correctly to begin with. Most modern
projects would probably not have built (not just OpenSSL). As a
Windows developer, the Windows SDK is an implied requirement for any
project.
Thanks for that Thomas. Generally what you say in this list is good but
in this case I do not think your statement is very helpful. It would be
more collaborative to suggest a way to do that just for those people who
have missed it, ... as I attempted to do in my original posting. I was
pointing out that the standard tools did not do that for you. Perhaps
you do not use the Microsoft Visual Studio Command Prompt Window for
builds as I do.

If there is a previous requirement for a build, the documentation
generally states it. I am trying to help by suggesting a small change in
the documentation which might cut down questions in this list. If you
think things that you take for granted are too trivial to tell the list,
that is fine. I prefer to let people know problems I have had in the
past in the hope it will help some of them and make them and this list
more productive.

By the way I had built a number of other Windows products on the new
build environment before building OpenSSL, ... successfully and without
the Windows SDK. As I stated it was a new build environment. OpenSSL was
the fifth product I had built on the new environment and the first that
required the Windows SDK, so I am unsure if I agree with your statement.
Wouldn't it be better to explicitly state the requirement, rather than
rely on previous knowledge. Personally I am surprised that OpenSSL uses
a native crypto lib, not that I have investigated why.



______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Jeffrey Walton
2012-03-28 01:49:58 UTC
Permalink
Post by Thomas J. Hruska
Post by jeremy hunt
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions
for Microsoft Visual Studio.
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1
Details: (cut out for this reply, refer to my original posting if you
need help)
Regards,
Jeremy
If you had to do that, then your command line build environment on your
new machine was not set up correctly to begin with.  Most modern projects
would probably not have built (not just OpenSSL).  As a Windows developer,
the Windows SDK is an implied requirement for any project.
Thanks for that Thomas. Generally what you say in this list is good but in
this case I do not think your statement is very helpful. It would be more
collaborative to suggest a way to do that just for those people who have
missed it, ... as I attempted to do in my original posting. I was pointing
out that the standard tools did not do that for you. Perhaps you do not use
the Microsoft Visual Studio Command Prompt Window for builds as I do.
If there is a previous requirement for a build, the documentation generally
states it. I am trying to help by suggesting a small change in the
documentation which might cut down questions in this list. If you think
things that you take for granted are too trivial to tell the list, that is
fine. I prefer to let people know problems I have had in the past in the
hope it will help some of them and make them and this list more productive.
By the way I had built a number of other Windows products on the new build
environment before building OpenSSL, ... successfully and without the
Windows SDK. As I stated it was a new build environment. OpenSSL was the
fifth product I had built on the new environment and the first that required
the Windows SDK, so I am unsure if I agree with your statement. Wouldn't it
be better to explicitly state the requirement, rather than rely on previous
knowledge. Personally I am surprised that OpenSSL uses a native crypto lib,
not that I have investigated why.
Just guessing: CryptGenRandom function to help gather entropy
(http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx).
I know OpenSSL can also do a heap walk, too. Perhaps it does both.

I also believe OpenSSL interacts with Windows certificate store.

Jeff
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Lou Picciano
2012-03-28 02:14:59 UTC
Permalink
From: "Jeffrey Walton" <noloader-***@public.gmane.org>
To: openssl-users-MCmKBN63+***@public.gmane.org
Sent: Tuesday, March 27, 2012 9:49:58 PM
Subject: Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.
Post by Thomas J. Hruska
Post by jeremy hunt
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions
for Microsoft Visual Studio.
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1
Details: (cut out for this reply, refer to my original posting if you
need help)
Regards,
Jeremy
If you had to do that, then your command line build environment on your
...
Thanks for that Thomas. Generally what you say in this list is good but in
this case I do not think your statement is very helpful. ...
Just guessing: CryptGenRandom function to help gather entropy
(http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx).
I know OpenSSL can also do a heap walk, too. Perhaps it does both.

I also believe OpenSSL interacts with Windows certificate store.

Jeff
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org



Yes, am quite sure OpenSSL interacts with the Windows Certificate Store via the capi engine - happen to have just been researching this. Seem dependent on proper compile, and proper configuration of OpenSSL in order to enable the engine, but it's in there.


Lou Picciano
Ken Montagna
2012-06-20 15:52:25 UTC
Permalink
Why are you using VC2005? I use VC10, just do the following:
install MS sdk
install active perl
run configure per openssl INSTALL.W32 or 64 or readme
open the sdk cmd window

setenv /x86 /debug /2008
nmake ms\ntddl.mak
nmake ms\nt.mak

note: I use /2008 switch because I use it on a 2008 server, but it is the
same kernel as windows 7.
I add the ENABLE-CAPIENG compile flag for capi to the make files
Post by Thomas J. Hruska
Post by jeremy hunt
This posting is to help people to build OpenSSL 1.0.1 with Microsoft
Visual Studio. It may also indicate a required change to the build
instructions for Microsoft Visual Studio.
----------
I found I needed to install the Windows SDK and manually configure my
build environment to successfully build OpenSSL 1.0.1
-------
I recently had to move my build machine to another PC, and I needed to
build OpenSSL 1.0.1.
I had installed MS Visual Studio 2005 on a Win XP system.
I followed the excellent build instructions in the INSTALL.W32 file. I
built from a Visual Studio 2005 Command Prompt window as I always do.
Unfortunately my first build failed in the link phase because it
couldn't find crypt32.lib.
On further investigation I found that crypt32.lib was in the Microsoft
SDK which I had to download and install on my build machine.
I trashed my build directory and unpacked a new one, so I could go
through the configure script with the installed SDK. I started a new
Visual Studio 2005 Command Prompt Window for the build. Unfortunately
the configure script did not find the SDK libraries and my build failed
in the same place.
So I manually modified the vsvars32.bat file that the "Visual Studio
%Program Files%\Microsoft SDKs\Windows\7.0\Bin to PATH
%Program Files%\Microsoft SDKs\Windows\7.0\Include to INCLUDE
%Program Files%\Microsoft SDKs\Windows\7.0\Lib to LIB
(On my system this file can be found in %Program Files%\Microsoft Visual
Studio 8\Common7\Tools)
Again I trashed the build directory and unpacked a new one. I started a
new Visual Studio 2005 Command Prompt Window and went from the configure
phase right through to build and test. Everything worked beautifully.
All modules were built and all the tests passed successfully.
As I said, I hope this helps others and, if appropriate, the developers
might want to state the Microsoft SDK is a requirement for Visual Studio
builds.
Regards,
Jeremy
If you had to do that, then your command line build environment on your
new machine was not set up correctly to begin with. Most modern
projects would probably not have built (not just OpenSSL). As a Windows
developer, the Windows SDK is an implied requirement for any project.
--
Thomas Hruska
Shining Light Productions
Home of BMP2AVI and Win32 OpenSSL.
http://www.slproweb.com/
______________________________________________________________________
OpenSSL Project http://www.openssl.org
--
View this message in context: http://old.nabble.com/Successfully-building-openssl-1.0.1-with-Microsoft-Visual-Studio.-tp33558980p34043827.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Loading...