Friday, 31 August 2012

Try protojs serials : B. support C++

I will develop a web site using C++. I need a compiler for generating C++ codes from group.proto file.
A standard protocol buffer from google will be installed. I didn't describe how to install this here. Please refer to the official site:

Create a file under proto folder. Add some scripts into it.

rm output/js/*
rm output/c++/*
protoc --proto_path=./input --cpp_out=./output/c++ ./input/group.proto
pbj input/group.proto output/js/group.js

chmod +x ./

Now execute, you will see C++ and JavaScript files are both generated.

├── input
│   └── group.proto
└── output
    ├── c++
    │   ├──
    │   └── group.pb.h
    └── js
        └── group.js

4 directories, 5 files

No comments: