C++ tutorial missing no mention of how to link generated .pb.cc file against lprotobuf

20 views
Skip to first unread message

David Liu

unread,
Sep 27, 2019, 6:17:06 PM9/27/19
to Protocol Buffers
In the C++ tutorial, there's a section titled "Writing a message" with an example that includes the .pb.h file, but doesn't at all mention how to compile it (it took me a while before figuring out that for g++, I had to link to the protobuf library by passing -lprotobuf to g++). While this seems common knowledge for most experienced C++ programmers, the page being a tutorial probably means that piece of information should be explicitly mentioned.

Is there another more obvious way to link generated protobufs against my main application code? Perhaps bazel? No mention of it at all on the page...
Reply all
Reply to author
Forward
0 new messages