【问题标题】:MongoDB C++ Driver installation on Mac OS在 Mac OS 上安装 MongoDB C++ 驱动程序
【发布时间】:2012-07-18 13:07:22
【问题描述】:

我尝试安装 MongoDB 的驱动程序 C++ 已经 2 天了,但我一直遇到同样的错误(在 Mac OS X 环境中)

In file included from /opt/local/include/boost/filesystem/operations.hpp:24,
             from /opt/local/include/boost/filesystem/convenience.hpp:22,
             from pch.h:83,
             from pch.cpp:18:
/opt/local/include/boost/filesystem/config.hpp:16:5: error: #error Compiling Filesystem      version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
In file included from util/goodies.h:22,
             from pch.h:161,
             from pch.cpp:18:
 util/concurrency/mutex.h: In function 'boost::xtime mongo::incxtimemillis(long long int)':

在安装 lib 之前(通过执行“scons”),我通过 portmac(sudo port install boost)安装了 pcre 和 boost。

有什么想法吗?我现在真的卡住了..

谢谢各位。

【问题讨论】:

  • 您安装了哪个版本的boost?您要编译哪个版本的 C++ 驱动程序?看起来您可能从端口安装了不兼容的 boost 版本。

标签: c++ macos mongodb boost boost-filesystem


【解决方案1】:

你需要将 boost 库降级到 1.45 或更早的版本来构建 mongodb,因为它依赖于 boost::filesystem v2,但最新的 boost(v1.46 之后)默认使用 boost::filesystem v3。

http://www.boost.org/users/history/version_1_46_0.html

文件系统: 该库的版本 3 现在是默认的。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,降级到 boost 1.45 为我编译了它(感谢 Flier Lu)。我使用 MacPorts 安装 Boost;以下是有关如何降级的说明:

    https://trac.macports.org/wiki/howto/InstallingOlderPort

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-28
      • 1970-01-01
      • 2012-05-30
      • 2016-07-23
      • 1970-01-01
      • 1970-01-01
      • 2016-04-24
      相关资源
      最近更新 更多