Good evening. I'm currently attempting to integrate the protocol buffer library into an embedded code project I'm assigned to, which uses Windows 7 to flash code onto hardware.
I have followed
this guide to installing the protocol buffer libraries/binaries on windows, and believe I am very close to getting my project to compile. Currently, I have the following directory structure:
Desktop
install
bin
include
lib
ProtoTest
data_revised.pb.h
data_revised.pb.cc
main.cc
Where ProtoTest is where the code I want to compile resides, and the
install folder resulting from the compilation contains the binary for the protobuffer compiler, as well as the includes and libraries.
I wish to run the following command:
g++ -std=c++14 -L/cygdrive/c/Users/<username>/Desktop/install/lib/ \
-lprotobuf \
-I/cygdrive/c/Users/<username>/Desktop/install/include \
ProtoTest/data_revised.pb.cc ProtoTest/main.cc
However, when I run it, I get errors of this form:
g++ -std=c++14
-L/cygdrive/c/Users/solarcar/Desktop/install/lib/ -lprotobuf
-I/cygdrive/c/Users/solarcar/Desktop/install/include
ProtoTest/
data_revised.pb.cc ProtoTest/main.cc
In file included from ProtoTest/data_revised.pb.cc:4:0:
ProtoTest/data_revised.pb.h:181:8: error: 'void
IntTriplet::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*)
const' marked 'final', but is not virtual
void SerializeWithCachedSizes(
^~~~~~~~~~~~~~~~~~~~~~~~
ProtoTest/data_revised.pb.h:183:35: error:
'google::protobuf::uint8*
IntTriplet::InternalSerializeWithCachedSizesToArray(google::protobuf::uint8*)
const' marked 'final', but is not virtual
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
If I recompile the protocol buffer I'm using, I get slightly different errors:
/tmp/ccRjenfk.o:data_revised.pb.cc:(.text+0x22): undefined reference to
google::protobuf::internal::VerifyVersion(int, int, char const*)
or
...:data_revised.pb.cc:...:undefined reference to "google::protobuf::Message::SpaceUsedLong() const"
I'm a bit more lost as to how to fix this more recent error, since I am (hopefully) including the libraries correctly.
Is there any way I can verify the library is indeed being installed correctly?