grpc libs c++ static linking

836 views
Skip to first unread message

smita deshpande

unread,
Oct 5, 2023, 9:59:17 AM10/5/23
to grpc.io
Hello, 

I am trying to use helloworld *.pb files in my project and trying to link grpc and its dependent libraries (all the thirdparty and protobuf)  statically. I tried to use the order of libraries present in build.make file which gets generated in helloworld build folder. However, I am getting errors.


undefined reference to `absl::lts_20230802::log_internal::LogMessageFatal::LogMessageFatal(char const*, int, std::basic_string_view<char, std::char_traits<char> >)'
/usr/bin/ld: helloworld.pb.o: in function `helloworld::HelloReply::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)':

Could anyone please help with this? 

Thanks,
Smita

veb...@google.com

unread,
Oct 11, 2023, 3:48:19 PM10/11/23
to grpc.io
From the error message, linking to abseil library didn't seem to be done correctly. 
This example (https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/CMakeLists.txt) would be helpful to understand how it needs to be done.


Reply all
Reply to author
Forward
0 new messages