在 Ubuntu 中查找 Boost 库

Locating Boost Libraries in Ubuntu

本文关键字:Boost 查找 Ubuntu      更新时间:2023-10-16

我想构建一个利用 boost 库program_optionsiostreams的自动工具项目。因此,我安装了这些库:

sudo aptitude install libboost-iostreams-dev libboost-program_options-dev

现在./configure很好,程序编译了。但是,链接失败:

/usr/bin/ld: cannot find -lboost_program_options-mt
/usr/bin/ld: cannot find -lboost_iostreams-mt

这是一个有据可查的问题,可以通过修复自动工具内容或boost_program_options链接到boost_program_options-mt等来修复。我选择做后者,因为这不是我的项目。但是我无法找到 Ubuntu 中安装的库:

locate *boost*

返回文档和包信息的列表以及一些我不想要的 boost 库。 locate *program_options*为空。图书馆不在/usr/lib/lib...有什么想法吗?

对我来说,

它们在 ubuntu 13.04 中的/usr/lib64 下。但我会使用升压 m4让自动工具自动处理这些依赖项。因此,通过在 configure.in 中包含升压 m4,您可以指定所需的升压模块和版本。此外,它还会为您找到所需的路径。

有时这是不可能的,特别是对于较小的应用程序和自定义项目,对于将来,boost 包含位于/usr/include/boost 中,当然,这取决于系统类型和分布