Boost C++ 库安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2278881/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:50:48  来源:igfitidea点击:

Boost c++ library install

c++boost

提问by Rajesh Kumar J

I am not familiar with the usual build technique in linux I am using boost c++ library. Can any body guide me in installing and configuring boost c++ library. Thanks in advance

我不熟悉 linux 中常用的构建技术,我使用的是 boost c++ 库。任何机构都可以指导我安装和配置 boost C++ 库。提前致谢

回答by Hong

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/.

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.

你只会在 .so 下找到 boost /usr/lib/,比如/usr/lib/libboost_timer.so.1.48.0.

回答by Rob Kennedy

It's OK if you're not familiar with the usual build technique because Boost doesn't use the usual build technique. 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 instructionsis at the very, very bottom.

如果您不熟悉通常的构建技术也没关系,因为 Boost 不使用通常的构建技术。按照“入门”文档中的说明进行操作。确保您一直阅读到页面底部。Unix 特定指令的链接位于非常非常底部。

For most parts of Boost, installation is synonymous with unpacking the tarball into your preferred include directory. Other parts of Boost require compilation, so go to the Boost installation directory, run ./bootstrap.sh, and then run ./bjam install.

对于 Boost 的大多数部分,安装与将 tarball 解压缩到您首选的包含目录中是同义词。Boost 的其他部分需要编译,所以到 Boost 安装目录,运行./bootstrap.sh,然后运行./bjam install

回答by Chris Card

depending on the Linux distribution you are using, you'll probably find boost is already built and packaged for you, e.g. on Fedora "yum install boost"

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

回答by Neyroman

Rob Kennedy's answer is still valid except that is recommendednow to install with ./b2 instead of ./bjam.

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