continue
continue

Reputation: 11

Build OpenSSL in Visual Studio 2013

How to build OpenSSL in Visual Studio 2013? I try to compile in this lesson, but there is an error: Assembling: tmp32\x86_64cpuid.asm tmp32\x86_64cpuid.asm(1) : error A2088:END directive required at end of file NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\ I compiled under x64. What could be the problem? Thank you in advance.

Upvotes: 0

Views: 2837

Answers (4)

Petr
Petr

Reputation: 1

Update for Visual Studio 2017:

1) I used the 1.0.2h openssl source. I have not tried other versions.

2) Have perl installed and in your PATH.

3) Install NASM and add it to your PATH (e.g. to C:\NASM and/or edit the PATH setup below). The latest version (2.13.1) worked fine for me.

4) Check and, if needed, edit the path to vcvarsall.bat used below.

5) (optional) Edit the install folder in the command bellow (set via --prefix).

6) Open Command Prompt in the root directory of the downloaded source, (edit and) execute the following commands:

set PATH=%PATH%;C:\nasm

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat"" amd64

perl Configure VC-WIN64A --prefix=C:\openssl_x64 no-asm no-shared enable-tlsext enable-static-engine

ms\do_win64a

nmake -f ms\ntdll.mak

nmake -f ms\ntdll.mak install

7) (Optional) In case you have multiple versions of VS installed, you might want to verify that the correct version of nmake was executed (14.10.* and not e.g. 14.0* or 12.*)

Upvotes: 0

Raiden Core
Raiden Core

Reputation: 1605

Take this answer updated for visual studio 2015

1 - Make sure to use the 1.0.2h openssl source.

2 - Make sure that you install (Old) nasm (NOT THE LATEST): use version 2.11 [1]:http://www.nasm.us/pub/nasm/releasebuilds/2.11/ from 2013 and put it on your path.

3 - Open any normal Command Prompt (cmd) - administrator is preferred - and execute these commands in the root directory of the downloaded source.

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" amd64

perl Configure VC-WIN64A --prefix=C:\openssl_x64 no-asm no-shared enable-tlsext enable-static-engine

ms\do_win64a

nmake -f ms\ntdll.mak

nmake -f ms\ntdll.mak install

Upvotes: 1

Tuan
Tuan

Reputation: 2363

I wrote a note to build OpenSSL here (Unix and Windows).

Make sure you use the original OpenSSL source (do not re-use the compiled source code).

Open the Visual Studio x64 Win64 Command Prompt (2010) (in the Start menu)

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" amd64

perl Configure VC-WIN64A --prefix=C:\openssl_x64 no-asm no-shared enable-tlsext enable-static-engine

ms\do_win64a

nmake -f ms\ntdll.mak

nmake -f ms\ntdll.mak install

Upvotes: 5

Vtik
Vtik

Reputation: 3130

I remember encountering also the same error building OpenSSL 1.0.2d as a static library. A solution that worked for me is the following :

In a new command line window build OpenSSL and install it into C:\build\bin\openssl-1.0.2d-x64 directory:

cd C:\build\src\openssl-1.0.2d-x64
set PATH=%PATH%;C:\nasm
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
perl Configure VC-WIN64A --prefix=C:\build\bin\openssl-1.0.2d-x64 enable-static-engine
ms\do_win64a
nmake /f ms\nt.mak
nmake /f ms\nt.mak test
nmake /f ms\nt.mak install

Resulting build is located in C:\build\bin\openssl-1.0.2d-x64 directory.

Hope that helps !

Upvotes: 2

Related Questions