microsoft / openssl

A cross-platform cryptographic library
133 stars 57 forks source link

openssl-1.0.2p local build error with vs2015 #63

Closed higarry closed 5 years ago

higarry commented 5 years ago

I am building the openssl-1.0.2p WinRT locally, I was doing this by following the "INSTALL_WINUNIVERSAL". (Please note that this is for x86 debug)

errors are as following: 1>.\crypto\rand\randfile.c(331): error C2220: warning treated as error - no 'object' file generated 1>.\crypto\rand\randfile.c(331): warning C4013: 'getenv' undefined; assuming extern returning int

2>.\crypto\rand\randfile.c(331): error C2220: warning treated as error - no 'object' file generated 2>.\crypto\rand\randfile.c(331): warning C4013: 'getenv' undefined; assuming extern returning int 2>.\crypto\rand\randfile.c(331): warning C4047: '=': 'char ' differs in levels of indirection from 'int' 2>.\crypto\rand\randfile.c(337): warning C4047: '=': 'char ' differs in levels of indirection from 'int' 2>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\cl.EXE"' : return code '0x2'

Please have a look at this.

khouzam commented 5 years ago

Hi @higarry,

Which Windows 10 SDK do you have installed?

higarry commented 5 years ago

hi @khouzam,

I build this locally with Windows 10 SDK 14393 and Windows 10 SDK16299, both of them are failed.

1> randfile.c 1>.\crypto\rand\randfile.c(331): error C2220: warning treated as error - no 'object' file generated 1>.\crypto\rand\randfile.c(331): warning C4013: 'getenv' undefined; assuming extern returning int 1>.\crypto\rand\randfile.c(331): warning C4047: '=': 'char ' differs in levels of indirection from 'int' 1>.\crypto\rand\randfile.c(337): warning C4047: '=': 'char ' differs in levels of indirection from 'int' 1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2' 1> Stop. 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3073: The command "build.bat Debug Win32" exited with code 2.

khouzam commented 5 years ago

Thanks. I'll setup a machine with only VS 2015 and try to repro.

khouzam commented 5 years ago

Hi @higarry

Thanks for reporting this. Can you please try the PR #64 to see if this fixes your issue. I reproed the break and the fix worked, but I would like your validation.

After your confirmation, I'll merge it in.

Thanks

higarry commented 5 years ago

Hi @khouzam,

Thanks for the changes. I validated your changes locally found that "NT-Universal-10.0-Dll-Unicode" project and NT-Universal-10.0-Static-Unicode project could build successfully. But the 2 testapp project failed with:

1> winrt.cpp 1>C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): error C2220: warning treated as error - no 'object' file generated 1>C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): warning C4467: usage of ATL attributes is deprecated 1> C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings 1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2' 1> Stop. 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3073: The command "build.bat Debug Win32" exited with code 2.

Please note that I am using Windows 10 SDK 14393 with vs2015.

higarry commented 5 years ago

I tried to build x64 - release and arm-release locally with SDK 14393, failed with below error:

X64 | Release 1> winrt.cpp 1>C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): error C2220: warning treated as error - no 'object' file generated 1>C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): warning C4467: usage of ATL attributes is deprecated 1> C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt\robuffer.h(46): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings 1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2' 1> Stop.

khouzam commented 5 years ago

Hi @higarry

I've push a change to silence the warning, but it seems that there might some more changes for VS2015 since we introduced the ARM64 build target, which is not supported at all on VS 2015.

Hopefully the current changes can unblock you.

khouzam commented 5 years ago

Hi @higarry

Have you tried the do_vsprojects script?

higarry commented 5 years ago

Hi @higarry

Have you tried the do_vsprojects script?

Sorry for the late response. Yes, it works fine. Thanks