c++ - 如何在 CentOS 7.3 64bit 上安装 boost 库?

标签 c++ boost centos7 yum

我需要在 CentOS 上构建一个使用 Boost 库的 C++ 项目。我试过这个:

yum install boost-devel

但是我遇到了依赖错误并且没有安装 Boost:

--> Processing Dependency: libicuuc.so.42()(64bit) for package: libboost_regex1_59_0-1.59.0-1.x86_64
--> Processing Dependency: libicui18n.so.42()(64bit) for package: libboost_regex1_59_0-1.59.0-1.x86_64
--> Processing Dependency: libicudata.so.42()(64bit) for package: libboost_regex1_59_0-1.59.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: libboost_log1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicuuc.so.42()(64bit)
Error: Package: libboost_locale1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicudata.so.42()(64bit)
Error: Package: libboost_regex1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicudata.so.42()(64bit)
Error: Package: libboost_locale1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicui18n.so.42()(64bit)
Error: Package: libboost_log1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicudata.so.42()(64bit)
Error: Package: libboost_graph1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicuuc.so.42()(64bit)
Error: Package: libboost_regex1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicuuc.so.42()(64bit)
Error: Package: libboost_graph1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicui18n.so.42()(64bit)
Error: Package: libboost_locale1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicuuc.so.42()(64bit)
Error: Package: libboost_regex1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicui18n.so.42()(64bit)
Error: Package: libboost_log1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicui18n.so.42()(64bit)
Error: Package: libboost_graph1_59_0-1.59.0-1.x86_64 (enetres)
           Requires: libicudata.so.42()(64bit)

我应该手动安装这些依赖项吗?或者到底哪里出了问题,我该怎么办?

最佳答案

通常在centos 7上,我做

yum update
yum install epel-release

然后

yum install boost boost-thread boost-devel

到目前为止,它对我有用。 也许前两个命令是您最初需要做的。以后有什么问题可以再问。 请注意,Boost 1.53.0 是 YUM 上的当前版本。如果您需要高于该版本的版本,则需要从源代码构建。参见 https://www.boost.org/doc/libs/1_73_0/more/getting_started/unix-variants.html了解详情。

关于c++ - 如何在 CentOS 7.3 64bit 上安装 boost 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44157279/

相关文章:

C++11 我可以确保 condition_variable.wait() 不会错过通知吗?

c++ - 在 QLabel 中绘制可缩放的 QPixmap

c++ - Boost Library的加权中位数被打破了吗?

c++ - 编译器提示模板参数的数量错误,即使它在 boost 库文件中是正确的

Apache 虚拟主机非 www 不工作

linux - Google Cloud Compute 上的多个 IP 地址

c++ - 再次随机化的问题

c++ - 搜索具有下限和上限的 map <pair<int, int>, ...>

c++ - 使用 Boost::Test 并行代码

node.js - 无法达到单个服务器的最大 tcp 连接数