Building grpc 1.46.3

421 views
Skip to first unread message

Aleh Linkin

unread,
Jun 9, 2022, 9:47:55 AM6/9/22
to grpc.io
Hi, I'd like to clarify one moment about building. If my project uses grpc and I build my project with c++17. Should I build grpc with c++17 or it is not necessary?

I see that after building grpc 1.46.3 and abseil with c++17 I can't after that build my project and got some under references like
```
 undefined reference to `google::protobuf::Empty::Empty(google::protobuf::Arena*)'
undefined reference to `grpc::ServerContextBase::MaybeMarkCancelledOnRead()'
undefined reference to `google::protobuf::internal::VerifyUTF8(google::protobuf::StringPiece, char const*)'
undefined reference to `google::protobuf::StringPiece::LogFatalSizeTooBig(unsigned long, char const*)'
undefined reference to `bool absl::lts_20210324::str_format_internal::FormatArgImpl::Dispatch<std::basic_string_view<char, std::char_traits<char> > >(absl::lts_20210324::str_format_internal::FormatArgImpl::Data, absl::lts_20210324::str_format_internal::FormatConversionSpecImpl, void*)'undefined reference to `absl::lts_20210324::str_format_internal::FormatPack(absl::lts_20210324::str_format_internal::UntypedFormatSpecImpl, absl::lts_20210324::Span<absl::lts_20210324::str_format_internal::FormatArgImpl const>)'
```

and some others.

Sincerely, Oleg

veb...@google.com

unread,
Jun 15, 2022, 1:39:09 PM6/15/22
to grpc.io
Hey Oleg, 

I think this is not because you're using C++17 but because your build might mixed up C++11 (or 14) and C++17 when building all components that gRPC needs.
Internally gRPC is being built with C++17 so it shouldn't have a build issue. 
If you think there is something gRPC needs to fix it, please give us a list of commands to build it. (preferably using a docker image)

Regards,
Esun.

Aleh Linkin

unread,
Jun 16, 2022, 3:19:21 AM6/16/22
to veb...@google.com, grpc.io
I have found that to make correct c++17 build we should set -DABSL_PROPAGATE_CXX_STD=OFF and -DCMAKE_CXX_STANDARD=1. -DABSL_PROPAGATE_CXX_STD=OFF is mandatory because in other case absl forces to use c++11


--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/0Ar_HcqtIvg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/de06e46d-3a68-4372-b2af-a990b2f15a6cn%40googlegroups.com.

Aleh Linkin

unread,
Jun 16, 2022, 6:18:50 AM6/16/22
to veb...@google.com, grpc.io
-DCMAKE_CXX_STANDARD=17, sorry

Esun Kim

unread,
Jun 16, 2022, 7:40:51 PM6/16/22
to Aleh Linkin, grpc.io
Thanks Aleh for the update. 

As you see, when building gRPC and all other dependencies, configurations such as C++ version should be the same. Hence, your fix sounds right to me.
--
Regards,
Esun.

Reply all
Reply to author
Forward
0 new messages