Build of grpc_csharp_ext failed on windows

97 views
Skip to first unread message

scho...@gmail.com

unread,
Oct 5, 2021, 6:54:09 AM10/5/21
to grpc.io
Currently we are building the grpc_csharp_ext.dll like this

```
set ARCHITECTURE=%1

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCHITECTURE%

set OpenSSLVer=Win32
if "%ARCHITECTURE%" == "x64" (
  set OpenSSLVer=Win64
)

cmake -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DgRPC_SSL_PROVIDER:STRING=package -DOPENSSL_ROOT_DIR:PATH=c:\OpenSSL-%OpenSSLVer% -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../../..

cmake --build . --target grpc_csharp_ext
```

with small changes in the CMakeList.txt to link with static OpenSSL lib
```
target_link_libraries(grpc_csharp_ext
  ${_gRPC_ALLTARGETS_LIBRARIES}
  ${_gRPC_SSL_LIBRARIES}
  gpr
  grpc
)
```
This was working fine in version 1.28. Now we updated our soruces to 1.41 and the build of the dll failed with some Linker errors

```

upb.lib(text_encode.c.obj) : error LNK2019: unresolved external symbol upb_fielddef_isseq referenced in function txtenc_
msg
upb.lib(reflection.c.obj) : error LNK2001: unresolved external symbol upb_fielddef_isseq
upb.lib(text_encode.c.obj) : error LNK2019: unresolved external symbol upb_fielddef_ismap referenced in function txtenc_
msg
upb.lib(reflection.c.obj) : error LNK2001: unresolved external symbol upb_fielddef_ismap
upb.lib(text_encode.c.obj) : error LNK2019: unresolved external symbol upb_fielddef_msgsubdef referenced in function txt
enc_array
upb.lib(reflection.c.obj) : error LNK2001: unresolved external symbol upb_fielddef_msgsubdef
upb.lib(text_encode.c.obj) : error LNK2019: unresolved external symbol upb_fielddef_enumsubdef referenced in function tx

tenc_array
...
...
``` 
When running the `run_tests.py` it also failed with `Some tests failed`. Did something change between the versions for building the grpc_csharp_ext.dll? 

scho...@gmail.com

unread,
Oct 7, 2021, 11:30:21 AM10/7/21
to grpc.io
Got it working. Seems while merging v1.41.0 we resolved a conflict in CMakeList.txt wrong.
Reply all
Reply to author
Forward
0 new messages