zoukankan      html  css  js  c++  java
  • windows 编译mongodb 2.4

      最近一直想使用一下No SQL。 选择了mongodb.

    看官方文档:

      终于成功了:

    步骤如下:

    我附加官方的文档,增加需要注意的地方

    Build with Visual Studio 2010


    Binaries are available for most platforms. Most users won’t need to compile MongoDB themselves. Every prebuilt binary has been regression tested. See the Downloads page for these prebuilt binaries.


    MongoDB can be compiled for Windows (32 and 64 bit) using Visual C++. SCons is the make mechanism, although a solution file is also included in the project for convenience when using the Visual Studio IDE. (These instructions don’t work using Visual Studio Express, which must be uninstalled to get Visual Studio Professional/Ultimate to work properly. VSE can only do 32 bit builds.)

    多数用户不需要编译的, 

    These instructions are for MongoDB versions 2.1.1 and later.


    Get the MongoDB Source Code


    Do one of the following:


    Download the source code from Downloads page


    Install Git, then:


    Clone the repository by issuing the following:


    git clone git://github.com/mongodb/mongo.git   // 推荐git下载源代码, 官方下载的那17M 不靠谱
    For more information, see https://github.com/mongodb/mongo.


    ////////////////////////////////我是照着这个来弄的没商议 安装吧

    Build with SCons


    Install Python: http://www.python.org/download/releases/2.7.2/.


    Make sure to install the 32-bit version of python and not the 64-bit as the SCons binaries below are 32-bit.


    It is recommended you install pywin32 if you want to do parallel builds (scons -j): http://sourceforge.net/projects/pywin32/


    Install SCons:


    http://sourceforge.net/projects/scons/


    Add the python scripts directory (e.g., C:\Python27\Scripts) to your PATH.


    Build:


    scons --release --64             // build mongod
    scons --release --64 mongoclient.lib  // build C++ client driver library
    scons --release --64 core             // build all end user components


    scons --dd --64             // build mongod
    scons --dd --32 mongoclient.lib  // build C++ client driver library
    scons --dd --64 core             // build all end user components

    Add --64 or --32 to get the 64- and 32-bit versions, respectively. Replace --release with --dd to build a debug build.


    错误提示修正:

    1. atomic_intrinsics_win32.h 文件有一个不识别的宏
    // static const bool kHaveInterlocked64 = (_WIN32_WINNT >= _WIN32_WINNT_VISTA);
    //modify by eagle
    static const bool kHaveInterlocked64 = (_WIN32_WINNT >= 0x0600);

    2. 编译的客户端连接例子

      请使用MT 调试, 通过 

    上图

  • 相关阅读:
    .NET WinForm下StatusStrip控件如何设置分隔线及部分子控件右对齐
    winform 弹出窗体指定位置
    命名空间“System.Web”中不存在类型或命名空间名称“Optimization”(是否缺少程序集引用?)
    SQL之case when then用法详解
    VS2015编译错误:调用的目标发生了异常--->此实现不是Windows平台FLPS验证的加密算法的一部分。
    .NET Core 控制台中文乱码问题!
    IOC 依赖注入 Unity
    《重构:改善代码的既有设计》读书笔记
    .NET中的堆(Heap)和栈(Stack)的本质
    浅谈 Sql Server 游标
  • 原文地址:https://www.cnblogs.com/eaglezzb/p/4176505.html
Copyright © 2011-2022 走看看