gpt4 book ai didi

c++ - 在 Mac 上使用 CodeBlocks 安装 Boost

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:48:47 27 4
gpt4 key购买 nike

我正在尝试查找有关如何在 Mac 上安装带有代码块的 Boost 库的说明。具体来说,我只需要使用 Boost Spirit 库。 CodeBlocks 网页在 http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef 提供了适用于 Windows 的说明。 .我一直在尝试为 Mac 找到类似的说明,但未能找到。有没有人指点一下?

最佳答案

来自文档 Structure / Include (直接在介绍之后):

Spirit is a header file only library. There are no libraries to link to

这确实意味着您只需要指明 header 的位置,就可以了。

  1. 下载current version (通过 http://www.boost.org/ )
  2. 摘录
  3. 添加到包含路径

请注意,Boost 的所有必需品也是如此:Phoenix、Proto、Fusion、Mpl、Typetraits、Utility 都是仅 header

最后,您可以创建一个与您使用的相匹配的 boost 子集。例如。为

“切除”子集
 #include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>

在我的系统上我可以做

~/custom/boost/bin.v2/tools/bcp/gcc-4.7/release/link-static/bcp \
--boost=/home/sehe/custom/boost --scan ./test.cpp outdir/

产生 2757 个文件(bzip2 压缩后总计约 1.1MiB)

关于c++ - 在 Mac 上使用 CodeBlocks 安装 Boost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18771244/

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