Vcpkg: MSVC Linker Errors for GRPC & OpenSSL

Created on 30 Aug 2018  路  8Comments  路  Source: microsoft/vcpkg

I get these errors just trying to do vcpkg install grpc on AppVeyor which recently upgraded from MSVC v15.7.5 to v15.8.1. I did not get the errors prior to their update yesterday August 29th 2018.

https://github.com/appveyor/ci/issues/2563
https://github.com/appveyor/ci/issues/2558

Creating library grpc_csharp_ext.lib and object grpc_csharp_ext.exp
grpc.lib(ssl_transport_security.cc.obj) : error LNK2019: unresolved external symbol _sk_num referenced in function "enum tsi_result __cdecl peer_from_x509(struct x509_st *,int,struct tsi_peer *)" (?peer_from_x509@@YA?AW4tsi_result@@PAUx509_st@@HPAUtsi_peer@@@Z)
grpc.lib(ssl_transport_security.cc.obj) : error LNK2019: unresolved external symbol _sk_value referenced in function "enum tsi_result __cdecl add_subject_alt_names_properties_to_peer(struct tsi_peer *,struct stack_st_GENERAL_NAME *,unsigned int)" (?add_subject_alt_names_properties_to_peer@@YA?AW4tsi_result@@PAUtsi_peer@@PAUstack_st_GENERAL_NAME@@I@Z)
grpc.lib(ssl_transport_security.cc.obj) : error LNK2019: unresolved external symbol _sk_new_null referenced in function "enum tsi_result __cdecl x509_store_load_certs(struct x509_store_st *,char const *,unsigned int,struct stack_st_X509_NAME * *)" (?x509_store_load_certs@@YA?AW4tsi_result@@PAUx509_store_st@@PBDIPAPAUstack_st_X509_NAME@@@Z)

Most helpful comment

Success! It's OpenSSL-related issue - thanks @Voskrese for drawing attention to that.
Removing both folders with OpenSSL 1.1 fixes the build:

rd /s /q C:\OpenSSL-v11-Win32
rd /s /q C:\OpenSSL-v11-Win64

Successful build: https://ci.appveyor.com/project/appveyor-tests/vcpkg-test/build/1.0.7

Will be working on the fix to the image.

All 8 comments

I am getting similar problems, for me, this is specific to x64-windows-static. x86-windows-static works fine, and x64-windows also builds fine.

These are the messages in the console, I am also attaching the log:

It is not obvious to me what is wrong, but I am happy to try out patches or PRs if that helps.

> .\vcpkg install grpc:x64-windows-static
The following packages will be built and installed:
    grpc[core]:x64-windows-static
Starting package 1/1: grpc:x64-windows-static
Building package grpc[core]:x64-windows-static...
-- Using cached C:/Users/coryan/source/vcpkg/downloads/grpc-grpc-v1.14.1.tar.gz
-- Using source at C:/Users/coryan/source/vcpkg/buildtrees/grpc/src/v1.14.1-55a400e627
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
CMake Error at scripts/cmake/vcpkg_build_cmake.cmake:175 (message):
    Command failed: C:/ProgramData/chocolatey/lib/cmake.portable/tools/cmake-3.12.1-win64-x64/bin/cmake.exe;--build;.;--config;Debug;--target;install;--;-v;-j1
    Working Directory: C:/Users/coryan/source/vcpkg/buildtrees/grpc/x64-windows-static-dbg
    See logs for more information:
      C:\Users\coryan\source\vcpkg\buildtrees\grpc\install-x64-windows-static-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/grpc/portfile.cmake:60 (vcpkg_install_cmake)
  scripts/ports.cmake:71 (include)


Error: Building package grpc:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: grpc:x64-windows-static
  Vcpkg version: 0.0.113-nohash

Additionally, attach any relevant sections from the log files above.
[963/1256] cmd.exe /C "cd . && C:\ProgramData\chocolatey\lib\cmake.portable\tools\cmake-3.12.1-win64-x64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\grpc_ruby_plugin.dir --manifests  -- C:\PROGRA~2\MICROS~1\2017\PROFES~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe  CMakeFiles\grpc_ruby_plugin.dir\src\compiler\ruby_plugin.cc.obj  /out:grpc_ruby_plugin.exe /implib:grpc_ruby_plugin.lib /pdb:grpc_ruby_plugin.pdb /version:0.0  /machine:x64 /debug /INCREMENTAL /subsystem:console  C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib grpc_plugin_support.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: grpc_ruby_plugin.exe 
cmd.exe /C "cd . && C:\ProgramData\chocolatey\lib\cmake.portable\tools\cmake-3.12.1-win64-x64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\grpc_ruby_plugin.dir --manifests  -- C:\PROGRA~2\MICROS~1\2017\PROFES~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe  CMakeFiles\grpc_ruby_plugin.dir\src\compiler\ruby_plugin.cc.obj  /out:grpc_ruby_plugin.exe /implib:grpc_ruby_plugin.lib /pdb:grpc_ruby_plugin.pdb /version:0.0  /machine:x64 /debug /INCREMENTAL /subsystem:console  C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib grpc_plugin_support.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
Microsoft (R) Incremental Linker Version 14.15.26726.0
Copyright (C) Microsoft Corporation.  All rights reserved.

FINAL LINK: command "C:\PROGRA~2\MICROS~1\2017\PROFES~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe CMakeFiles\grpc_ruby_plugin.dir\src\compiler\ruby_plugin.cc.obj /out:grpc_ruby_plugin.exe /implib:grpc_ruby_plugin.lib /pdb:grpc_ruby_plugin.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib grpc_plugin_support.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotocd.lib C:\Users\coryan\source\vcpkg\installed\x64-windows-static\debug\lib\libprotobufd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\grpc_ruby_plugin.dir/intermediate.manifest CMakeFiles\grpc_ruby_plugin.dir/manifest.res" failed (exit code 1168) with the following output:
Microsoft (R) Incremental Linker Version 14.15.26726.0
Copyright (C) Microsoft Corporation.  All rights reserved.

are there any libraries?

\libprotocd.lib \libprotobufd.lib grpc_plugin_support.lib \libprotocd.lib \libprotobufd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

FAILED: grpc_ruby_plugin.exe

Installing grpc library is also failing on VS 15.8.2 and updated vcpkg. This is the build reproducing the issue: https://ci.appveyor.com/project/appveyor-tests/vcpkg-test/build/1.0.6
CMake log can be found here: https://ci.appveyor.com/project/appveyor-tests/vcpkg-test/build/1.0.6/artifacts

~And for what is worth, the version of vcpkg (e6f7b763230a53183cadd16d29214e36bd2c9c14) before the upgrade to grpc-1.14.1 works fine in my environment.~

I was wrong, that version does not work either....

@FeodorFitsner

[1128/1256] cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\grpc_csharp_ext.dir --manifests  -- C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x86\link.exe  CMakeFiles\grpc_csharp_ext.dir\src\csharp\ext\grpc_csharp_ext.c.obj  /out:grpc_csharp_ext.dll /implib:grpc_csharp_ext.lib /pdb:grpc_csharp_ext.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  grpc.lib gpr.lib C:\OpenSSL-v11-Win32\lib\VC\libssl32MDd.lib C:\OpenSSL-v11-Win32\lib\VC\libcrypto32MDd.lib C:\Tools\vcpkg\installed\x86-windows\debug\lib\zlibd.lib C:\Tools\vcpkg\installed\x86-windows\debug\lib\cares.lib address_sorting.lib wsock32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
FAILED: grpc_csharp_ext.dll grpc_csharp_ext.lib 

C:\OpenSSL-v11-Win32 ?

libcrypto32* or libssl32* = (ssl_transport_security.cc.obj) : error LNK2019: unresolved external symbol _sk_num referenced in function "enum tsi_result __cdecl

Oh, that's interesting - great hint! Wondering how it's being able to discover C:\OpenSSL-v11-Win32 despite original OpenSSL 1.0.x exists in C:\OpenSSL-Win32?

Success! It's OpenSSL-related issue - thanks @Voskrese for drawing attention to that.
Removing both folders with OpenSSL 1.1 fixes the build:

rd /s /q C:\OpenSSL-v11-Win32
rd /s /q C:\OpenSSL-v11-Win64

Successful build: https://ci.appveyor.com/project/appveyor-tests/vcpkg-test/build/1.0.7

Will be working on the fix to the image.

I am going to close this issue now because it does seem to be resolved, at least with AppVeyor since their patch was made. https://github.com/enigma-dev/RadialGM/pull/34
If other people continue to have issues with vcpkg and OpenSSL, then they'll need to file a new issue because I am not able to provide any more information about other issues I do not have and it seems to be fixed here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madkoala picture madkoala  路  3Comments

oahzuw picture oahzuw  路  3Comments

grandprixgp picture grandprixgp  路  3Comments

pakdel picture pakdel  路  3Comments

jack17529 picture jack17529  路  3Comments