For C++, to determine the output name, just replace ".proto" with ".pb.h" or ".pb.cc".
You have to make sure that you run the C++ code generator at the same time as your plugin. --cpp_out must appear first on the command line, e.g.: # CORRECT protoc --cpp_out=outdir --myplugin_out=outdir # WRONG protoc --myplugin_out=outdir --cpp_out=outdir # wrong order protoc --myplugin_out=outdir # missing --cpp_out protoc --cpp_out=outdir --myplugin_out=outdir2 # output directories don't match On Mon, Jul 5, 2010 at 9:29 AM, marcmo <oliver.muel...@gmail.com> wrote: > jason, thanks for the response. > for the stuff that i needed i found everything and the plugin stuff > works great (i use it to generate a custom rpc implementation of the > lite version that is suited for our embedded environment) > insertion points where not needed so i almost forgot about that. today > a got around to try this again. > while the code that you point to is a nice illustration of how you can > use insertion points, is still haven't figured out how to correctly > point my plugin to the file that it should insert the code into. (i > always hit the "Tried to insert into file that doesn't exist" in the > command_line_interface.cc no matter how i call the OpenForInsert() > function) > > the test code seems quite involved but i think i will try to poke > around a little more... > > i understand that the plugin infrastructure is still evolving but also > think that it could really be beneficial to have some little starter > examples. > cheers, > oliver > > On Jun 2, 6:25 pm, Jason Hsueh <jas...@google.com> wrote: > > Does the test plugin help? There is a test code generator that is used in > > the unittest for command_line_interface.cc: > http://code.google.com/p/protobuf/source/browse/trunk/src/google/prot... > > > > > > > > On Tue, Jun 1, 2010 at 4:00 AM, marcmo <oliver.muel...@gmail.com> wrote: > > > hello, > > > i'm trying to make use of the compiler plugin infrastructure that was > > > released with 2.3.0. > > > > > using the c++ api to access the elements in a *.proto file seems > > > straight forward and i got a small example working. > > > but i have trouble to use the insertion points correctly. > > > > > can anybody provide a small example of it? > > > thanks a lot! > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Protocol Buffers" group. > > > To post to this group, send email to proto...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com> > <protobuf%2bunsubscr...@googlegroups.c om> > > > . > > > 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 proto...@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@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 proto...@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.