Prerequisites
Make sure you have the following prerequisites installed. The commands listed below show how to install the prerequisites on Ubuntu Linux.
- Boost:
- Protocol Buffers C++ library (libprotobuf.so):
- zlib:
- OpenSSL:
sudo apt-get install libboost-dev
sudo apt-get install libprotobuf-dev
sudo apt-get install zlib1g-dev
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:
- Run protoc to generate Demo.pb.cc:
cd cpp/demo
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:
- Run make, to build DemoServer, DemoClient and libRCFProto.so:
- Install libRCFProto.so, so the system can find it:
cd cpp/demo/make
make
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:
- Build the demo server:
- Build the demo client:
cd cpp/demo
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
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:
- Run the demo client (in a different command prompt):
./DemoServer
./DemoClient