Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 357 by cauverys...@gmail.com: error messages while compiling a c++ program that uses .proto file.
http://code.google.com/p/protobuf/issues/detail?id=357

What steps will reproduce the problem?
1. g++ searchinc.cpp


What is the expected output? What do you see instead?
It is expected to compile. Instead I get a number of errors as shown below:

searchinc.cpp:2:18: error: ‘google’ has not been declared
searchinc.cpp:2:26: error: ‘protobuf’ is not a namespace-name
searchinc.cpp:2:34: error: expected namespace-name before ‘;’ token
searchinc.cpp:5:1: error: ‘protobuf’ does not name a type
searchinc.cpp:6:1: error: ‘protobuf’ does not name a type
searchinc.cpp:7:1: error: ‘SearchService’ does not name a type
searchinc.cpp: In function ‘void DoSearch()’:
searchinc.cpp:14:3: error: ‘channel’ was not declared in this scope
searchinc.cpp:14:17: error: expected type-specifier before ‘MyRpcChannel’
searchinc.cpp:14:17: error: expected ‘;’ before ‘MyRpcChannel’
searchinc.cpp:15:3: error: ‘controller’ was not declared in this scope
searchinc.cpp:15:20: error: expected type-specifier before ‘MyRpcController’
searchinc.cpp:15:20: error: expected ‘;’ before ‘MyRpcController’
searchinc.cpp:19:3: error: ‘service’ was not declared in this scope
searchinc.cpp:19:17: error: expected type-specifier before ‘SearchService’
searchinc.cpp:19:17: error: expected ‘;’ before ‘SearchService’
searchinc.cpp:25:50: error: ‘protobuf’ has not been declared
searchinc.cpp:25:73: error: ‘Done’ was not declared in this scope
searchinc.cpp: In function ‘void Done()’:
searchinc.cpp:29:10: error: ‘service’ was not declared in this scope
searchinc.cpp:30:10: error: ‘channel’ was not declared in this scope
searchinc.cpp:31:10: error: ‘controller’ was not declared in this scope


Please use labels and text to provide additional information.

I have downloaded and installed the protoc compiler. It is installed in /usr/local/bin. I can also find the libprotobuf and libprotobuf-lite libraries in /usr/local/lib.
The .proto file compiled successfully and produced pb.h and pb.cc files.
I have used an example provided in this very site.
I am new to linux as well as protobufs. I am attaching all the files.


Attachments:
        search.pb.cc  31.0 KB
        search.pb.h  19.8 KB
        search.proto  374 bytes
        searchinc.cpp  864 bytes

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to