shiyilei / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compilation fails with protobuf 2.1.0 #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install version 2.1.0 of the protobuf library
2. Compile version 0.10 of protobuf-c

What is the expected output? What do you see instead?

Expected: successful compilation.

Instead, you get an error message:

cxx-generate-packed-data.cc: In function ‘void dump_test_unknown_fields()’:
cxx-generate-packed-data.cc:761: error: no matching function for call to
‘google::protobuf::UnknownFieldSet::AddField(int)’
/opt/local/include/google/protobuf/unknown_field_set.h:108: note:
candidates are: void google::protobuf::UnknownFieldSet::AddField(const
google::protobuf::UnknownField&)
cxx-generate-packed-data.cc:762: error: ‘class
google::protobuf::UnknownField’ has no member named ‘add_varint’
cxx-generate-packed-data.cc:763: error: no matching function for call to
‘google::protobuf::UnknownFieldSet::AddField(int)’
/opt/local/include/google/protobuf/unknown_field_set.h:108: note:
candidates are: void google::protobuf::UnknownFieldSet::AddField(const
google::protobuf::UnknownField&)
cxx-generate-packed-data.cc:764: error: ‘class
google::protobuf::UnknownField’ has no member named ‘add_fixed32’
cxx-generate-packed-data.cc:768: error: no matching function for call to
‘google::protobuf::UnknownFieldSet::AddField(int)’
/opt/local/include/google/protobuf/unknown_field_set.h:108: note:
candidates are: void google::protobuf::UnknownFieldSet::AddField(const
google::protobuf::UnknownField&)
cxx-generate-packed-data.cc:769: error: ‘class
google::protobuf::UnknownField’ has no member named ‘add_length_delimited’
cxx-generate-packed-data.cc:770: error: no matching function for call to
‘google::protobuf::UnknownFieldSet::AddField(int)’
/opt/local/include/google/protobuf/unknown_field_set.h:108: note:
candidates are: void google::protobuf::UnknownFieldSet::AddField(const
google::protobuf::UnknownField&)
cxx-generate-packed-data.cc:771: error: ‘class
google::protobuf::UnknownField’ has no member named ‘add_fixed64’

It looks like the UnknownField class's interface has changed.

Original issue reported on code.google.com by dcreager on 30 May 2009 at 10:39

GoogleCodeExporter commented 8 years ago
Here's a patch — with this applied, the source compiles and “make check” 
succeeds.

Original comment by dcreager on 30 May 2009 at 10:51

Attachments:

GoogleCodeExporter commented 8 years ago
Here's a better patch — it checks which version of libprotobuf is installed, 
and uses
the new interface if it's >= 2.1.0, or the old interface otherwise.

Original comment by dcreager on 31 May 2009 at 11:34

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks!  I committed your second patch to SVN and it'll be in the 0.11 release.

Original comment by lahike...@gmail.com on 11 Jun 2009 at 12:51

GoogleCodeExporter commented 8 years ago

Original comment by lahike...@gmail.com on 11 Jun 2009 at 12:52