Skip to content

How to Compile libxayagame in Ubuntu

xaya edited this page May 26, 2019 · 1 revision

How to Compile libxayagame in Ubuntu 18.04.02

This will help you to compile libxayagame in Ubuntu so you can use it in other tutorials and even in your own games.

Most dependencies can simply be installed, but some you will need to build and install from source.

Update and Upgrade Ubuntu

sudo apt-get update
sudo apt-get upgrade

Install Prerequisites & Dependencies with apt

sudo apt-get install build-essential libgflags-dev cmake-curses-gui libtool pkg-config git libzmq3-dev libsqlite3-dev liblmdb-dev libgoogle-glog-dev libssl-dev libgtest-dev cmake unzip libargtable2-dev libhiredis-dev protobuf-compiler libprotobuf-dev autoconf-archive libcurl4-gnutls-dev libjsoncpp-dev libmicrohttpd-dev

Build & Install gtest

cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make -j2
sudo cp *.a /usr/lib
export GTEST_CFLAGS="/usr/src/gtest"
export GTEST_LIBS="/usr/src/gtest"
export GTEST_MAIN_CFLAGS=/usr/src/gtest
export GTEST_MAIN_LIBS=/usr/src/gtest
echo 'export GTEST_CFLAGS="/usr/src/gtest"' >> ~/.profile
echo 'export GTEST_LIBS="/usr/src/gtest"' >> ~/.profile
echo 'export GTEST_MAIN_CFLAGS="/usr/src/gtest"' >> ~/.profile
echo 'export GTEST_MAIN_LIBS="/usr/src/gtest"' >> ~/.profile

Build & Install Catch2

cd ~/
git clone
cd Catch2
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install

Build & Install libjson-rpc-cpp

cd ~/
git clone
cd libjson-rpc-cpp
mkdir build
cd build
cmake .. && make -j2
sudo make install
sudo ldconfig 
sudo sed -i.bak 's/-Llib\/pkgconfig/-L\/usr\/local\/lib\/pkgconfig/' /usr/local/lib/pkgconfig/libjsonrpccpp-client.pc
sudo sed -i.bak 's/-Llib\/pkgconfig/-L\/usr\/local\/lib\/pkgconfig/' /usr/local/lib/pkgconfig/libjsonrpccpp-common.pc
sudo sed -i.bak 's/-Llib\/pkgconfig/-L\/usr\/local\/lib\/pkgconfig/' /usr/local/lib/pkgconfig/libjsonrpccpp-server.pc

Build & Install libxayagame

cd ~/
git clone
cd ~/libxayagame
make -j2
sudo make install


Congratulations! You've just built and installed libxayagame. You can now proceed on to the Hello World in C++ tutorial where we'll put libxayagame to good use!

Update libxayagame

We update libxayagame periodically. If you wish to update your build, enter the following into a terminal.

cd ~/libxayagame
git pull
make clean
make -j2
sudo make install

You're now up-to-date with the latest version!

Clone this wiki locally
You can’t perform that action at this time.