Linux Commands Examples

A great documentation place for Linux commands

protoc

compile protocol buffer description files

Synopsis

protoc [--cpp_out=OUT_DIR] [--java_out=OUT_DIR] [--python_out=OUT_DIR] [-IPATH --proto-path=PATH] PROTO_FILE

protoc {-h | --help}

protoc --version


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

11
source
            
protoc --python_out=./ message.proto
3
source
            
protoc --java_out=../ $1
3
source
            
protoc --go_out=. sal.proto
0
source
            
protoc --java_out=../../../ $1
0
source
            
protoc --go_out=. ohhai.proto
protoc --go_out=. filesystem.proto
0
source
            
protoc --go_out=. proto.proto
0
source
            
protoc *.proto --cpp_out=.
0
source
            
protoc --go_out=. server.proto
protoc --go_out=. client.proto
protoc --python_out=../ client.proto
0
source
            
protoc --cpp_out=../ ./Docs.proto Messages.proto

description

protoc is a compiler for protocol buffers definitions files. It can can generate C++, Java and Python source code for the classes defined in PROTO_FILE.

options

-IPATH, --proto_path=PATH

Specify the directory in which to search for imports. May be specified multiple times; directories will be searched in order. If not given, the current working directory is used.

--cpp_out=OUT_DIR

Enable generation of C++ bindings and store them in OUT_DIR.

--java_out=OUT_DIR

Enable generation of Java bindings and store them in OUT_DIR.

--python_out=OUT_DIR

Enable generation of Python bindings and store them in OUT_DIR.

-h, --help

Show summary of options.

--version

Show version of program.

Note that at least one of the --cpp_out, --java_out and --python_out options must be given (otherwise the program has nothing to do). It's also possible to specify more than one.

copyright

Copyright © 2007 Iustin Pop

This manual page was written for the Debian system (but may be used by others).

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.


bugs

The program currently exits with code 255 for all errors, which makes it hard to differentiante from scripts the actual error.

The upstreams BTS can be found at http://code.google.com/p/protobuf/issues/list.


see also

More documentation about protocol buffers syntax and APIs is available online at http://code.google.com/apis/protocolbuffers/docs/overview.html.


author

Iustin Pop <iusty[:at:]k1024[:dot:]org>

Wrote this manpage for the Debian system.

How can this site be more helpful to YOU ?


give  feedback