Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Jeremy Hunt-2
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                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Thomas J. Hruska
On 3/23/2012 12:53 AM, jeremy hunt wrote:

> 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

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                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Jeremy Hunt-2
Thomas J. Hruska wrote:

> On 3/23/2012 12:53 AM, jeremy hunt wrote:
>> 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: (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                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Jeffrey Walton-3
On Sun, Mar 25, 2012 at 7:31 PM, jeremy hunt <[hidden email]> wrote:

> Thomas J. Hruska wrote:
>>
>> On 3/23/2012 12:53 AM, jeremy hunt wrote:
>>>
>>> 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: (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                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

Lou Picciano
From: "Jeffrey Walton" <[hidden email]>
To: [hidden email]
Sent: Tuesday, March 27, 2012 9:49:58 PM
Subject: Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

On Sun, Mar 25, 2012 at 7:31 PM, jeremy hunt <[hidden email]> wrote:

> Thomas J. Hruska wrote:
>>
>> On 3/23/2012 12:53 AM, jeremy hunt wrote:
>>>
>>> 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: (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                    [hidden email]
Automated List Manager                           [hidden email]

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
Reply | Threaded
Open this post in threaded view
|

Re: Successfully building openssl-1.0.1 with Microsoft Visual Studio.

ken@bitzermobile.com
In reply to this post by Thomas J. Hruska
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

Thomas J. Hruska wrote
On 3/23/2012 12:53 AM, jeremy hunt wrote:
> 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

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@openssl.org
Automated List Manager                           majordomo@openssl.org