Chris Stewart Chris Stewart - 3 months ago 56
C++ Question

Installing Boost 1.59.0 Ubuntu

I'm trying to install Boost 1.59.0 on Ubuntu, I cannot install it from

apt-get
because that contains an older version.

I'm cloning the
modular-boost
repo and I'm trying to build it with the following command:

$./bootstrap.sh --prefix=/usr/local
$./b2 headers


Finally I'm trying to confirm that that boost was installed with this simple c file

#include <boost/version.hpp>
#include <iostream>
#include <iomanip>

int main()
{
std::cout << "Boost version: "
<< BOOST_VERSION / 100000
<< "."
<< BOOST_VERSION / 100 % 1000
<< "."
<< BOOST_VERSION % 100
<< std::endl;
return 0;
}


However when I try to compile it I get the following error:

$ g++ boost_version.c
boost_version.c:1:29: fatal error: boost/version.hpp: No such file or directory
compilation terminated.


and I'm not sure where I am going wrong. I've looked at the other questions and it doesn't seem to resolve my problems.

Answer

Reading is hard, I was running

./b2

instead of

./b2 install
Comments