简体   繁体   English

Boost C++ 库安装

[英]Boost c++ library install

I am not familiar with the usual build technique in linux I am using boost c++ library.我不熟悉 linux 中常用的构建技术,我使用的是 boost c++ 库。 Can any body guide me in installing and configuring boost c++ library.任何机构都可以指导我安装和配置 boost C++ 库。 Thanks in advance提前致谢

My environment is Linux Fedora 15. On it, one can easily install boost by typing,我的环境是 Linux Fedora 15。在上面,可以通过键入轻松安装 boost,

$ yum install boost-devel

After installation, you'll find boost under /usr/include/boost/ .安装后,您将在/usr/include/boost/下找到 boost。

However, if you run,然而,如果你跑,

$yum install boost

you'll only find .so of boost under /usr/lib/ , like /usr/lib/libboost_timer.so.1.48.0 .你只会在/usr/lib/下找到 boost 的 .so ,比如/usr/lib/libboost_timer.so.1.48.0

It's OK if you're not familiar with the usual build technique because Boost doesn't use the usual build technique.如果您不熟悉通常的构建技术也没关系,因为 Boost 不使用通常的构建技术。 Follow the instructions in the "getting started" documentation .按照“入门”文档中的说明进行操作 Make sure you read all the way to the bottom of the page.确保您一直阅读到页面底部。 The link to the Unix-specific instructions is at the very, very bottom. Unix 特定指令的链接位于非常非常底部。

For most parts of Boost, installation is synonymous with unpacking the tarball into your preferred include directory.对于 Boost 的大多数部分,安装与将 tarball 解压缩到您首选的包含目录中是同义词。 Other parts of Boost require compilation, so go to the Boost installation directory, run ./bootstrap.sh , and then run ./bjam install . Boost 的其他部分需要编译,所以进入 Boost 安装目录,运行./bootstrap.sh ,然后运行./bjam install

根据您使用的 Linux 发行版,您可能会发现 boost 已经为您构建和打包,例如在 Fedora 上“yum install boost”

Rob Kennedy 的回答仍然有效,只是现在建议使用 ./b2 而不是 ./bjam 进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM