It looks like you are mixing one version of protoc with a different version
of the protobuf runtime (i.e. libprotobuf). It's important for the protobuf
generated code to be built with a protoc of the same version as the runtime
library.

On Tue, Jul 2, 2019 at 5:30 PM Ricardo Iglesias <[email protected]>
wrote:

> I'm not sure if this would necessarily change anything, but I should
> mention that I'm running all of this through the *Cygwin* application,
> which came with cmake, make, and g++ (which is how I compiled the library
> in teh first place).
>
> On Tuesday, July 2, 2019 at 5:26:48 PM UTC-7, Ricardo Iglesias wrote:
>>
>> 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 <http://goog_1006182188> 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?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/6bb6579a-d524-4cbe-8a3a-ea6978485f6a%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/6bb6579a-d524-4cbe-8a3a-ea6978485f6a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr6ey-D_1AG9B9vLCdaC71xQBy1jTD9y10ejSNxbf9jJ2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to