1

我想构建一个使用 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

这是一个有据可查的问题,可以通过修复 autotools 的东西或通过链接等等boost_program_options来解决。boost_program_options-mt我选择后者,因为这不是我的项目。但是我找不到安装在 Ubuntu 中的库:

locate *boost*

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

4

2 回答 2

1

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

于 2013-10-28T19:34:06.000 回答
0

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

于 2014-09-05T10:18:48.277 回答