Need basic help with unexplained steps building on Windows

71 views
Skip to first unread message

Kevin Mendel

unread,
Mar 5, 2024, 7:06:41 PMMar 5
to grpc.io
Hi. 
I'm new to gRPC. Trying to build gRPC on Windows to evaluate for a product.

I've been writing software for 30 years, but no one has experience with everything. 
And so much of BUILDING.md is going right over my head -- I've never used CMAKE in my life. Also, I swear many of the instructions are for Linux and I guess I am supposed to infer what to do on Windows, except I can't. 

So if anyone is around for noob-level questions, I would greatly appreciate. 

Just to explain my experience so far. 

First thing I tried is the vcpkg approach. But this failed so badly I decided it wasn't prudent to go that way. 

I got farther by downloading the repo and using CMAKE. 
But all the builds are blowing up with fatal errors that stdalign.h cannot be found. 
It's building against WinSDK 10.0.17763.0 -- which I know is wrong. 
I have 10.0.22000.0 installed. 
But I have tried a dozen different things and I cannot get the build to use 10.0.22000.0. 

It seems to be building something though.
I'd like to use the product of the build if I could -- maybe it's sufficient. 
But the build artifacts I want to use is another thing that's unexplained. 
I am supposed to "install" grpc. 
But that's also unexplained.

So here I am, fairly severely stuck. 

If you ask me what I want to do, it is "build code to use grpc". YOU tell ME how to get there, I don't have a preference. 

Thanks in advance.
Kevin 

Tony Newell

unread,
Mar 6, 2024, 4:34:57 AMMar 6
to grpc.io
Instructions for building on Windows are here: https://github.com/grpc/grpc/blob/v1.62.0/BUILDING.md

How are you intending to use gRPC on Windows? If with C++ then I think you need to do the build as instructed about, if with other languages (e.g. python, Java or C#) then there are prebuilt packages that you can use.

Kevin Mendel

unread,
Mar 7, 2024, 1:10:08 PMMar 7
to grpc.io
Hi. 

(Sorry for not getting back right away. Work took some turns.)

BUILDING.md is where I am starting from. 
This is what I have done so far, and then I am blocked by build failures.

md .build
cd .build
cmake .. -G "Visual Studio 16 2019"
cmake --build . --config Release


The build fails. There are 168 errors all basically the same, but from different files:

19>###HIDING###\grpc\third_party\boringssl-with-bazel\src\crypto\asn1\../internal.h(136,1): fatal error C1083: Cannot open include file: 'stdalign.h': No such file or directory

I have sleuthed this to the point where I feel sure I am building with the wrong Windows SDK.

19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_memory.h(76,5): warning C5105: macro expansion producing 'defined' has undefined behavior

10.0.17763.0 doesn't have stdalign.h.
However, I have 10.0.22000.0 installed.
This version does have 10.0.22000.0.
And various things I have read on the web indicate that I need to use 10.0.22000.0 or later.

So I am supposing that if I can induce grpc to build with Windows SDK 10.0.22000.0 I will solve this problem.
But how???

Thanks as always,
Kevin

yas...@google.com

unread,
Mar 18, 2024, 8:31:39 PMMar 18
to grpc.io
Running `cmake --help` should give you a list of the available generators.

If you have for example, Visual Studio 2022 installed, you should see a line like "Visual Studio 17 2022" or something like that. That should work as well. Very likely, it will work without overriding the default generator (`-G` option).

You can also use bazel as a build system if you prefer.

Reply all
Reply to author
Forward
0 new messages