2017-08-05 46 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解決了這個問題。

相關問題