我需要在 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/