Solution to the error 0xC0000135 reported by cl.exe when compiling openssl with vc2010

I am currently working on IoT aspects such as LoRa. According to Zhou Xiansen's blog post "Compiling MQTT C++ Client for Windows" //www.cnblogs.com/XiaoGuanYu/p/8168714.html Before compiling mqtt, press the following blog post:

Mr_Xie: openssl windows platform compilation library https://www.cnblogs.com/xie-tong/p/7825460.html

concussion: Compile OpenSSL under Windows https://www.cnblogs.com/zc2014blog/archive/2017/08/02/7272355.html

When preparing the win32 version of the openssl library, vc2010 reported the following error:

E:\openssl\openssl-1.0.2p>nmake -f ms\ntdll.mak

Microsoft (R) 程序维护实用工具 10.00.30319.01 版
版权所有(C) Microsoft Corporation。保留所有权利。

Building OpenSSL
perl .\util\copy-if-different.pl ".\crypto\buildinf.h" "tmp32dll\buildinf.h"
Copying: ./crypto/buildinf.h to tmp32dll/buildinf.h
perl .\util\copy-if-different.pl ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h"
Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
cl /Fotmp32dll\mem_clr.obj  -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS  -DDSO_WIN32 -W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DOPENSSL_NO_STATIC_ENGINE /Zi /Fdtmp32dll/lib -D_WINDLL  -DOPENSSL_BUILD_SHLIBCRYPTO -c .\crypto\mem_clr.c
NMAKE : fatal error U1077: “"c:\Program Files\Microsoft Visual Studio 10.0\vc\bin\cl.EXE"”: 返回代码“0xc0000135”
Stop.

Retrieving online solutions, it is said that vcvar32.bat was not executed. So, execute vcvar32.bat in the bin directory of vc2010, and report the following error:

C:\Program Files\Microsoft Visual Studio 10.0\VC>.\bin\vcvars32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
此时不应有 Management。

Haha, I am familiar with this error. I wrote a blog post about it when compiling boost. Be familiar with the road, copy vcvars32 to the openssl directory, open the vcvars32.bat file, add echo to print debugging statements, and find that an error occurs when the following statements are executed:

if "%xxx"=="yyy" ( 
SET "PATH=%FSHARPINSTALLDIR%;%PATH%"
)

Change the code as follows:

if "%xxx"=="yyy" ( 
SET PATH=%FSHARPINSTALLDIR%;%PATH%
)

Continue to compile and pass.

Guess you like

Origin blog.csdn.net/hylaking/article/details/83586964