Installing Boost 1.59.0 Ubuntu

Installing Boost 1.59.0 Ubuntu

本文关键字:Ubuntu Boost Installing      更新时间:2023-10-16

我正试图在Ubuntu上安装Boost 1.59.0,我无法从apt-get安装它,因为它包含旧版本。

我正在克隆modular-boost repo,并尝试使用以下命令构建它:

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

最后,我试图确认这个简单的c文件安装了boost

#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;
}

然而,当我试图编译它时,我得到了以下错误:

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

我不确定我哪里出了问题。我看了其他问题,但似乎并不能解决我的问题。

阅读很难,我正在运行

./b2

而不是

./b2 install