/>


RCFProto C++ Demo

This section describes how to build and run the RCFProto C++ demo server and client, on Unix platforms, using command line tools. You will need the source distribution to follow these steps.
Prerequisites
Make sure you have the following prerequisites installed. The commands listed below show how to install the prerequisites on Ubuntu Linux.

  • Boost:

  • sudo apt-get install libboost-dev

  • Protocol Buffers C++ library (libprotobuf.so):

  • sudo apt-get install libprotobuf-dev

  • zlib:

  • sudo apt-get install zlib1g-dev

  • OpenSSL:

  • sudo apt-get install libssl-dev

Generate source code for demo Protocol Buffer messages (Demo.pb.cc)
  • From the root directory of the distribution, cd to the demo directory:

  • cd cpp/demo

  • Run protoc to generate Demo.pb.cc:

  • protoc Demo.proto --cpp_out=.

Building the C++ demo server and client, using make
A simple makefile is provided in the source distribution, for building the C++ demo.

  • From the root directory of the distribution, cd to the demo makefile directory:

  • cd cpp/demo/make

  • Run make, to build DemoServer, DemoClient and libRCFProto.so:

  • make

  • Install libRCFProto.so, so the system can find it:

  • cp libRCFProto.so /usr/lib

Building the C++ demo server and client, using g++
Alternatively, instead of using the provided makefile, you can build the demo server and demo client directly with g++.

  • From the root directory of the distribution, cd to the demo directory:

  • cd cpp/demo

  • Build the demo server:

  • g++ -oDemoServer DemoServer.cpp Demo.pb.cc ../src/RCFProto.cpp ../src/RCF/src/RCF/RCF.cpp -DRCF_USE_ZLIB -DRCF_USE_OPENSSL -I../src -I../src/RCF/include -lpthread -lprotobuf -ldl

  • Build the demo client:

  • g++ -oDemoClient DemoClient.cpp Demo.pb.cc ../src/RCFProto.cpp ../src/RCF/src/RCF/RCF.cpp -DRCF_USE_ZLIB -DRCF_USE_OPENSSL -I../src -I../src/RCF/include -lpthread -lprotobuf -ldl

Running the C++ demo server and client
  • Run the demo server:

  • ./DemoServer

  • Run the demo client (in a different command prompt):

  • ./DemoClient