Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium
New issue 420 by [email protected]: code generation problem when using
namespaces and import from a root directory
http://code.google.com/p/protobuf/issues/detail?id=420
What steps will reproduce the problem?
1. create directory ns1 and subdirectory ns2 (ex <project_path>\ns1\ns2)
2. create a first proto file with a message within package ns1.ns2; (ex
person.proto)
3. create a second proto file in the same package ns1.ns2; and add
import "ns1/ns2/First.proto"; + a message using the message declared in
step 2. (ex addressbook.proto)
4. for each proto file generate code using the command: protoc
-I="<project_path>" -I=. --cpp_out=. <file_name>.proto
What is the expected output? What do you see instead?
Generated code should compile but instead there is a problem with names of
few generated functions used in generated outer classes.
Ex:
In file addressbook.pb.cc, function void
protobuf_AddDesc_addressbook_2eproto() calls
function ::ns1::ns2::protobuf_AddDesc_ns1_2fns2_2fPerson_2eproto() instead
of ::ns1::ns2::protobuf_AddDesc_Person_2eproto() declared in person.pb.h
What version of the product are you using? On what operating system?
protoc --version --> libprotoc 2.4.1
Tested on Windows XP and Windows Seven
Please provide any additional information below.
Full example available in attachment
Attachments:
ns1.zip 11.4 KB
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.