I've just downloaded and installed protobuf. The library installed
just fine, and the included examples compile and run correctly on the
command line. That is, something like "c++ foo-example.cc foo-
protocol.pb.cc -lprotobuf -o foo-example" completes without error and
produces a working binary.
However, when I try to have Xcode compile the same
foo-protocol.pb.cc
(even just that file alone, apart from the rest of the project), I get
278 errors in the protobuf headers. Here are the first few:
/usr/local/include/google/protobuf/descriptor.h:250: error: expected
identifier before numeric constant
/usr/local/include/google/protobuf/descriptor.h:250: error: expected
`}' before numeric constant
/usr/local/include/google/protobuf/descriptor.h:250: error: expected
unqualified-id before numeric constant
/usr/local/include/google/protobuf/descriptor.h:307: error: non-member
function 'const std::string& google::protobuf::name()' cannot have cv-
qualifier
/usr/local/include/google/protobuf/descriptor.h:308: error: non-member
function 'const std::string& google::protobuf::full_name()' cannot
have cv-qualifier
/usr/local/include/google/protobuf/descriptor.h:309: error: non-member
function 'const google::protobuf::FileDescriptor*
google::protobuf::file()' cannot have cv-qualifier
/usr/local/include/google/protobuf/descriptor.h:310: error: non-member
function 'bool google::protobuf::is_extension()' cannot have cv-
qualifier
/usr/local/include/google/protobuf/descriptor.h:311: error: non-member
function 'int google::protobuf::number()' cannot have cv-qualifier
Nothing fancy exists in this project. I have simply created an empty
Xcode project, added the .proto file and a script build stage that
runs protoc, and hit "go." I'd assume this is a problem in how Xcode
sets up its projects by default, but I'm out of ideas about what might
be going wrong.
Help! Does anyone have any advice?
Thanks in advance,
Kevin