2017-08-05 88 views
1

我试图使用Visual C++(安装Visual Studio 2015)从源代码(分支OpenSSL_1_0_1-stable)构建OpenSSL,请遵循指示here“构建OpenSSL时不支持编译ARM平台的桌面应用程序”当我构建OpenSSL时

当我运行nmake -f ms\ntdll.mak我得到以下的输出:

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 
Copyright (C) Microsoft Corporation. All rights reserved. 

Building OpenSSL 
     perl util/copy.pl ".\crypto\buildinf.h" "tmp32dll\buildinf.h" 
Copying: ./crypto/buildinf.h to tmp32dll/buildinf.h 
     perl util/copy.pl ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h" 
Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h 
     cl /Fotmp32dll\uplink.obj -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -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 -c ms\uplink.c 
uplink.c 
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt.h(205): fatal error C1189: #error: Compiling Desktop applications for the ARM platform is not supported. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_arm\cl.EXE"' : return code '0x2' 
Stop. 

ms/ntdll.mak文件内容:

# This makefile has been automatically generated from the OpenSSL distribution. 
# This single makefile will build the complete OpenSSL distribution and 
# by default leave the 'interesting' output files in .\out and the stuff 
# that needs deleting in .\tmp. 
# The file was generated by running 'make makefile.one', which 
# does a 'make files', which writes all the environment variables from all 
# the makefiles to the file call MINFO. This file is used by 
# util\mk1mf.pl to generate makefile.one. 
# The 'makefile per directory' system suites me when developing this 
# library and also so I can 'distribute' indervidual library sections. 
# The one monster makefile better suits building in non-unix 
# environments. 

INSTALLTOP=D:\TelegramDesktop\Libraries\openssl\Release 
OPENSSLDIR=D:\TelegramDesktop\Libraries\openssl\Release\ssl 

# Set your compiler options 
PLATFORM=VC-WIN32 
CC=cl 
CFLAG= /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -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  
APP_CFLAG= /Zi /Fd$(TMP_D)/app 
LIB_CFLAG= /Zi /Fd$(TMP_D)/lib -D_WINDLL 
SHLIB_CFLAG= 
APP_EX_OBJ=setargv.obj $(OBJ_D)\applink.obj /implib:$(TMP_D)\junk.lib 
SHLIB_EX_OBJ= 
# add extra libraries to this define, for solaris -lsocket -lnsl would 
# be added 
EX_LIBS=ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib 

# The OpenSSL directory 
SRC_D=. 

LINK_CMD=link 
LFLAGS=/nologo /subsystem:console /opt:ref /debug 
RSC=rc 

# The output directory for everything intersting 
OUT_D=out32dll 
# The output directory for all the temporary muck 
TMP_D=tmp32dll 
# The output directory for the header files 
INC_D=inc32 
INCO_D=inc32\openssl 

PERL=perl 
CP=$(PERL) util/copy.pl 
RM=del /Q 
RANLIB= 
MKDIR=$(PERL) util/mkdir-p.pl 
MKLIB=lib /nologo 
MLFLAGS= /nologo /subsystem:console /opt:ref /debug /dll 
ASM=ml /nologo /Cp /coff /c /Cx /Zi 

# FIPS validated module and support file locations 

FIPSDIR=\usr\local\ssl\fips-2.0 
BASEADDR=0xFB00000 
FIPSLIB_D=$(FIPSDIR)\lib 
FIPS_PREMAIN_SRC=$(FIPSLIB_D)\fips_premain.c 
O_FIPSCANISTER=$(FIPSLIB_D)\fipscanister.lib 
FIPS_SHA1_EXE=$(FIPSDIR)\bin\fips_standalone_sha1.exe 
E_PREMAIN_DSO=fips_premain_dso 
PREMAIN_DSO_EXE=$(BIN_D)\fips_premain_dso.exe 
FIPSLINK=$(PERL) $(FIPSDIR)\bin\fipslink.pl 

运行nmake -f ms\nt.mak产生相同的错误。

我不确定为什么搭建平台VC-WIN32导致关于ARM平台的错误。此外,我还没有发现VS2015上的这个错误,只有VS2013及以下版本,其中针对ARM平台的编译实际上不被支持。

有什么建议吗?

+1

这听起来像你在ARM开发人员提示下。 Visual Studio会安装四个或五个不同的开发人员提示。选择x86开发人员提示。 – jww

+0

@jww你说得对。事实上,我发现这是之前的解决方案(并回答了问题......) –

回答

2

我发现了什么是错误的:

我在VS2015 x64 ARM Cross Tools Command Prompt,而不是在VS2015 x86 Native Cross Tools Command Prompt运行命令。

运行在VS2015 x86 Native Cross Tools Command Prompt解决了这个问题。

相关问题