Skip to content
muhler edited this page Apr 12, 2012 · 2 revisions

The information below is only relevant to debian releases squeeze and older,
because debian releases wheezy and younger provide Boost 1.49 libraries.
Boost 1.47 or later is required to compile the latest WebSocket++ library.

Here is a detailed guide to install Boost 1.47 manually and build the WebSocket++ library subsequently.

  • Download boost_1_47_0.tar.gz from www.boost.org
  • Copy to /usr/local
  • Unzip with tar xvfz boost_1_47_0.tar.gz

After that there is a directory /usr/local/boost_1_47_0. This directory is called the BOOST ROOT directory.

  • cd /usr/local/boost_1_47_0
  • mkdir libbin
  • ./bootstrap.sh --prefix=libbin
  • ./b2 install

This resulting libraries are placed in /usr/local/boost_1_47_0/libbin/lib
so that you could manually link an executable against these libraries.
For example the following command compiles an boost example:
g++ -I/usr/local/boost_1_47_0 boost_link_example.cpp -o boost_link_example -L/usr/local/boost_1_47_0/libbin/lib/ -lboost_regex

For the dynamic linked libraries to be found, you have to adjust the LD_LIBRARY_PATH variable:

  1. Create the file /etc/ld.so.conf.d/local.conf
  2. Add the following single line: /usr/local/boost_1_47_0/libbin/lib
  3. run the ldconfig command

Adjust WebSocket++ Makefile

Add the following string to the variable libs assignment:
-L/usr/local/boost_1_47_0/libbin/lib/.
This line should than look like:
libs = -L/usr/local/boost_1_47_0/libbin/lib/ -lboost_system -lboost_date_time -lboost_regex -lboost_random

Add the following line right after the libs assignment line:
boostdir = /usr/local/boost_1_47_0

Add the following string to all cxxflags_<xx> assignments:
-I$(boostdir)

You can now simply run make and make install.