make_openssl32.bat -----------
D:
cd D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\
call vcvars32.bat
c:
cd c:\
cd openssl-1.0.2g
perl Configure VC-WIN32 no-asm --prefix=C:\openssl-1.0.2g\win32
call ms\do_ms.bat
call ms\do_win32
rem nt compiles to lib
nmake -f ms\nt.mak
rem nmake -f ms\nt.mak test
nmake -f ms\nt.mak install
pause
make_openssl64.bat --------
D:
cd D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\
call vcvars64.bat
c:
cd c:\
cd openssl-1.0.2g
perl Configure VC-WIN64A no-asm --prefix=C:\openssl-1.0.2g\win64
call ms\do_ms.bat
call ms\do_win64a
rem nt compiles to lib
nmake -f ms\nt.mak
rem nmake -f ms\nt.mak test
nmake -f ms\nt.mak install
pause
Reference URL and original text:
https://bbs.csdn.net/topics/392193545?page=1
I also just came into contact with openssl. I saw an installation tutorial and started directly, but I took a lot of detours. It is recommended that you read more information and then install it. If there is a problem, don't give up in a hurry. Check the problem code on the Internet and solve it one by one. After reading the installation tutorials shared on the Internet, everyone installed it several times, which took a few days. I am also looking up a lot of information, and it took a long time to install it successfully, so I also share my installation process. For your reference, if there are any deficiencies, you are welcome to correct me if I am wrong.
(PS: If you want to see the original INSTALL file, then please open the decompression directory of OpenSSL, there are two files INSTALL.W32 and INSTALL.W64 below, open it with Notepad, you can see the detailed information about the installation Explanation)
——> If there are students, the installation will be successful.
1. Download ActivePerl 5.24.1
download URL: https://www.activestate.com/activeperl/downloads
2. Install ActivePerl software:
install it step by step. There are options to add to the environment variables above. After the installation is successful, you need to set the environment variables.
For example, if I install ActivePerl in the C:\Perl64\ directory, select Path, click the Edit button, add C:\Perl64\site\bin;C:\Perl64\bin; to it, and confirm. (Personally, it is recommended to install it to the C drive, and follow-up is a good operation)
How to confirm the installation is successful, run cmd, enter perl -v, and then press Enter, the following display appears, it is successful
3. Install Microsoft Visual Studio 2010
Microsoft visual_studio_2010_professional software installation package http ://pan.baidu.com/s/1o6SsDn0
Of course other versions are also available. This software is relatively large, and the installation time is relatively long. Be patient and install it step by step.
Add C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64; to the system environment variable (the system may have added C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ bin, if not, add it), the specific path of your installation shall
prevail The version is: 2.12.02 http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/ Then install and add its installation path to the system environment variable Path. For example: C:\ Users\lenovo\AppData\Local\NASM 5. Download the OpenSSL address: http://www.openssl.org/source/ After downloading, unzip it to your own directory. It is recommended that the C drive does not contain Chinese names and spaces. directory, which is convenient for subsequent operations. For example, I C:\openssl 6. Initialize the compilation environment to open all programs, find the Visual Studio x64 Win64 command prompt (2010) tool in the Visual Studio Tools folder
Here is the Visual Studio x64 Win64 Command Prompt (2010) tool in the Visual Studio Tools folder.
Enter the Visual Studio 2010 installation directory C:\Program Files (x86)\Microsoft Visual Studio 10.0\ and
execute the command: cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64
Execute the command: vcvars64.bat
7. Execute configure
, first point the command to your openssl directory, (this is to put Openssl on the C drive or put VS2010 on the same drive as it is)
or you can directly cd to: cd C:\openssl
after entering
Then implement the command: perl Configure VC-WIN64 no-asm --prefix=C:\openssl
(because openssl is installed to C:\openssl, write the following path according to your storage path)
In addition: When the openssl you downloaded is For higher versions, such as openssl-1.0.2g, you need to add no-asm here, indicating that assembly is not used. If you do not add it, an error will occur when executing the nmake command. But if the download is openssl-1.0.1c, it seems that it can be successful without adding no-asm.
The lesson of blood, I did not operate correctly in this step, I have been making mistakes in the subsequent nmake, I can't find the reason, and I almost have to give up.
I will cry if I continue! ! !
There are some differences in the commands configured by everyone: 1. perl Configure VC-WIN64A
2. Perl Configure VC-WIN64A --perfix=C:\openssl\win64 (or its storage path)
I have not succeeded in either, but when the above command is unsuccessful, you can try these two.
The map command is 32-bit, and I forgot to take a screenshot at that time, but the results are basically the same.
A successful screenshot (this is also 32-bit, basically the same)
may have this problem at this time:
It looks like you don't have either nmake or dmake.exe on your path
This problem has also troubled me for a long time, I checked a lot of information and None of the methods worked, finally, it was done with the help of a post. If you have the same problem, you can refer to it.
http://www.cnblogs.com/emanlee/archive/2012/08/11/2633849.html
8. Execute the ms\do_nasm
input command: ms\do_nasm
did not think that it would be successful at the time and there is no screenshot, it is also very possible here NAMKE: fatal error u1077..., return code "0x43" and other errors, this is the problem I mentioned in step 7 above, which has been bothering me for a long time, so I won't repeat it here. If there is a problem, see step 7 above. .
This is generally the case.
9. Execute "ms\do_win64a" and
enter the command: ms\do_win64a
Forgot to take a screenshot!
[b]10. The environment is configured again[/b]
Navigate to the command prompt to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 (VS2010 installation location), then enter vcvars64.bat, it will display Setting environment for using Microsoft Visual Studio 2010 x64 tools. Without this step, the next step will prompt nmake is not an internal or external command.
It has been configured before. Some of them can be successfully configured here, while others are not. The specific reason is not clear. It is recommended to set it once.
11. Execute nmake -f ms\nt.mak (this is a static library, followed by a dynamic library description)
to locate the command prompt again, that is, cd to C:\openssl (that is, go back to the openssl source directory) and
enter Command: nmake -f ms\nt.mak;
after execution, two folders out32 and tmp32 will be generated in the openssl-1.0.1g directory, two static libraries and some executable files will be generated in the out32 folder, and the tmp32 folder will be generated The corresponding assembly file will be generated in .
12. Execute and test: nmake -f ms\nt.mak test
Enter the command: nmake -f ms\nt.mak test;
check whether the previous compilation was successful, if successful, the word "passed all tests" will be displayed at the end
13. Execute the command : nmake -f ms\nt.mak install
successfully will generate bin, include, lib, ssl four folders in the C:\openss\win64 directory
to install OpenSSL here successfully!
14. Follow-up instructions
a. The above compiles the release library. If the debug library is compiled, change the VC-WIN64A in the above step 7 to debug-VC-WIN64A;
b. If the dynamic library is compiled, use ms\ntdll .mak can replace the ms\nt.mak used in step 11 above.
There are several other commands that may be used:
Test the OpenSSL dynamic library: nmake -f ms\ntdll.mak test
Test the OpenSSL static library: nmake -f ms\nt.mak test
Install the OpenSSL dynamic library: nmake -f ms\ntdll .mak install
installs the OpenSSL static library: nmake -f ms\nt.mak install
clears the last OpenSSL dynamic library compilation for recompilation: nmake -f ms\ntdll.mak clean
clears the last OpenSSL static library compilation for recompilation Compile: nmake -f ms\nt.mak clean
Reference: http://www.linuxidc.com/Linux/2014-10/108502.htm
http://blog.csdn.net/zh516846937/article/details/40188065