-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSVC] GRPC failed to build due to error C2370: 'google::protobuf::internal::MapField<Derived,Key,T,kKeyFieldType_,kValueFieldType_>::kVTable': redefinition; different storage class #35297
Comments
I'm not sure what |
set _CL_=/permissive- means add option /permissive- to the build process. You can find the detailed info here about this option. I'm not sure if the root cause of this issue is a protobuf issue or a gRPC issue, but I built protobuf and it didn't have this error, it built pass. @yashykt |
@Zhaojun-Liu I have the exact same error. Did you find a solution? Z:\projects\cpp\network\mygrpc\external\grpc-src\third_party\protobuf\src\google/protobuf/map_field.h(682): error C2370: 'google::protobuf::internal::MapField<Derived,Key,T,kKeyFieldType_,kValueFieldType_>::kVTable': redefinition; different storage class |
@JeySamir You can check if you build with option /permissive-, if yes, remove this option, it will build pass. |
If you are able to build protobuf and install without error with this option, could you try using |
@yashykt I tried to add
Also, I tried the latest commit c910004 with the original steps, it still failed due to error C2370. |
For I suspect that you are running into the same error with the absl dependency that you are running into with protobuf. Could you try the same thing with absl? i.e., install absl separately and specify Also, have you tried this with bazel? |
Also, how to build gRPC with bazel? Could you share some docs? |
What version of gRPC and what language are you using?
GRPC commit we used : 12c0058
Language: c++
What operating system (Linux, Windows,...) and version?
Windows Server 2022 21H2
What runtime / compiler are you using (e.g. python version or version of gcc)
msvc
What did you do?
Repro steps:
git -C "F:\gitP\grpc\grpc" submodule foreach git reset --hard
git -C "F:\gitP\grpc\grpc" submodule foreach git clean -xdf
git -C "F:\gitP\grpc\grpc" submodule update --init --recursive
What did you expect to see?
build pass without error.
What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
detailed logs: build.log
Note:
If I remove the option /permissive-, it will build pass.
See TROUBLESHOOTING.md for how to diagnose problems better.
Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: