Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having trouble building OpenSSL on Windows 7 64-bit

I am trying to build OpenSSL on Windows 7 for a work project, but I am having trouble.

The INSTALL instructions say that the easy way to do this:

Quick Start
-----------

If you want to just get on with it, do:

on Windows (only pick one of the targets for configuration):

$ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
$ nmake
$ nmake test
$ nmake install

I was able to run perl Configure VC-WIN64A no problem. However, when I try running nmake, I get the following output:

>C:\Users\jget952\Downloads\openssl-1.1.0f>"C:\Program Files (x86)\Microsoft >Visual Studio 14.0\VC\bin\amd64\nmake.exe"
>
>Microsoft (R) Program Maintenance Utility Version 14.00.24225.1
>Copyright (C) Microsoft Corporation.  All rights reserved.
>
>"C:\Program Files (x86)\Microsoft Visual Studio 
>14.0\VC\bin\amd64\nmake.exe" depend && "C:\Program Files (x86)\Microsoft Visual >Studio 14.0\VC\bin\amd64\nmake.exe" _all
>
>Microsoft (R) Program Maintenance Utility Version 14.00.24225.1
>Copyright (C) Microsoft Corporation.  All rights reserved.
>
>
>Microsoft (R) Program Maintenance Utility Version 14.00.24225.1
>Copyright (C) Microsoft Corporation.  All rights reserved.
>
>cl  /I "." /I "crypto\include" /I "include" -DOPENSSL_USE_APPLINK -
>DDSO_WIN32 -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC >-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOP
>ENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM ->DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM ->DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM "-DENGIN
>ESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"" "->DOPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -W3 -wd4090 -Gs0 -GF -Gy ->nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D
>_CRT_SECURE_NO_DEPRECATE -DUNICODE -D_UNICODE /MD /O2 /Zi /Fdossl_static -c >/Focrypto\aes\aes_ige.obj "crypto\aes\aes_ige.c"
>aes_ige.c
>C:\Users\jget952\Downloads\openssl-1.1.0f\e_os.h(200): fatal error C1083: >Cannot >open include file: 'winsock2.h': No such file or directory
>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio >14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
>Stop.
>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio >14.0\VC\bin\amd64\nmake.exe"' : return code '0x2'
>Stop.
>
>C:\Users\jget952\Downloads\openssl-1.1.0f>
like image 844
Razorfoot Avatar asked Nov 03 '17 11:11

Razorfoot


2 Answers

Turns out that because I was using a normal command prompt instead of a visual studio command prompt, that nmake wasn't able to find all the libraries it needed.

like image 174
Razorfoot Avatar answered Sep 19 '22 00:09

Razorfoot


You have to use VC environnement. You have to find vcvarsall.bat in your visual studio installation.

With VS 2019 & VC installed :

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
nmake
like image 38
Sky Voyager Avatar answered Sep 18 '22 00:09

Sky Voyager