Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with gRPC, cannot include <google/protobuf/port_def.inc>

Tags:

include

grpc

After days trying to compile successfully gRPC, I have this problem, following this tutorial (https://www.infopulse.com/blog/grpc-framework-by-google-tutorial/) when trying to compile the example code:

cannot open include file "google/protobuf/port_def.inc"

The weird thing is that the other included stuff seems to work, but this one is keeping giving problem even after trying different guides to install gRPC. Anyone can think of a solution to this?

like image 380
user7434770 Avatar asked Apr 30 '26 04:04

user7434770


1 Answers

I guess you're trying to compile protobuf files generated with a different version of profobuf than you have installed. It's safest to regenerate the implementations from the .proto-files yourself.

I.e.

protoc -I=$SRC_DIR --cpp_out=$DST_DIR $SRC_DIR/addressbook.proto

More here: https://developers.google.com/protocol-buffers/docs/cpptutorial

like image 153
zoomix Avatar answered May 05 '26 10:05

zoomix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!