This wasn't the issue. It compiled just fine when I moved the 
-lprotobuf
to the end of the compilation. 

Additionally, I'm not sure why the libprotobuf would be a different 
version, since I had followed the steps on the github readme to get both 
the protoc and the libprotobuf. The code runs fine for now. 


On Wednesday, July 3, 2019 at 2:15:22 PM UTC-7, Adam Cozzette wrote:
>
> 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] 
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/d836facf-60b9-41d6-9da4-334936ace869%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to