The function name is determined by the source proto file path. Looks like you always generate messages from a single .proto file. You would have to generate the message in different files. Otherwise, even if you worked around the function name issue, the runtime DescriptorPool would complained about duplicated file descriptors.
On Thu, Mar 1, 2012 at 6:41 AM, Julien PONNOU <julien.pon...@gmail.com>wrote: > Hello, > > When I include several couples of .h/.cc in my project, I got the > following errors during the compilation: > > error C2086: 'google::protobuf::ProtobufOnceType `anonymous- > namespace'::protobuf_AssignDescriptors_once_' : redefinition > see declaration of '`anonymous- > namespace'::protobuf_AssignDescriptors_once_' > error C2084: function 'void `anonymous- > namespace'::protobuf_AssignDescriptorsOnce(void)' already has a body > see previous definition of 'protobuf_AssignDescriptorsOnce' > error C2084: function 'void `anonymous- > namespace'::protobuf_RegisterTypes(const std::string &)' already has a > body > see previous definition of 'protobuf_RegisterTypes' > > Basically, it's telling me these functions are declared in all couples > of .h/.cc. Using a different package for each couple of .h/.cc > corrects the problem, but I don't want to do so. Without using any > package, can someone explain me how to solve this error ? > > Best regards, > > Julien. > > -- > 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. > > -- 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.