gpt4 book ai didi

c++ - 配置 : error: no boost. 找到文件系统库

转载 作者:太空狗 更新时间:2023-10-29 20:40:09 26 4
gpt4 key购买 nike

所以我正在尝试通过这个 github 安装 ncmpcpp ,第一步是运行 sh autogen.sh 脚本。我遇到了一些丢失的库等,但我已经能够安装它们并继续前进,直到现在。我进行了一些搜索并安装了一些我认为有助于修复它的东西,但无济于事。

sudo apt-get install libboost1.55-all-dev

sudo apt-get install libboost-system-dev

sudo apt-get install libboost-system1.54-dev

sudo apt-get install libboost1.54-dev

sudo apt-get install libboost-filesystem-dev

sudo apt-get install libboost-filesystem-dev libboost-thread-dev

事实上,我对 Boost 了解不够,或者我缺少什么无法自行修复它。

这是问题开始的地方:

checking for boost/filesystem.hpp... yes

checking for main in -lboost_filesystem-mt... no

configure: error: no boost.filesystem library found

编辑:这是 config.log 文件中“-lboost_filesystem-mt”周围的行。

configure:15510: checking for main in -lboost_filesystem-mt

configure:15529: g++ -o conftest -g -O2 -std=c++0x conftest.cpp -lboost_filesystem-mt >&5

/usr/bin/ld: cannot find -lboost_filesystem-mt

collect2: error: ld returned 1 exit status

configure:15529: $? = 1

configure: failed program was:

| /* confdefs.h */

...然后继续描述confdefs.h文件。

最佳答案

configure.ac 中删除这些链接(“设置 boost 环境”部分):

AS_IF([test -z "${BOOST_LIB_SUFFIX+x}"], [BOOST_LIB_SUFFIX=-mt])
AC_ARG_VAR([BOOST_LIB_SUFFIX], [Boost library name suffix [default=-mt]])

很久以前,Boost 库曾经有一个 -mt 后缀来表明它们是多线程感知的。 Debian/Ubuntu 几年前就放弃了。也许其他发行版保留了它。在任何情况下,Boost 库名称都不是很标准化,这就是为什么 configure 脚本经常尝试处理它们,而且通常是以错误的方式。

您可以删除这两行或像这样调用它:

$ BOOST_LIB_SUFFIX="" ./autogen.sh

正确的解决方法是将脚本转换为使用 the Autoconf Archive 中的 Boost 宏.

关于c++ - 配置 : error: no boost. 找到文件系统库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25222741/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com