MongoDB2.4.8 在win7下用VS2010编译出现了几个问题,解决后整理下供大家参考。
1、下载2.4.8源代码
wget http://fastdl.mongodb.org/src/mongodb-src-r2.4.8.zip
2、VS2010 打开mongodb-src-r2.4.8\src\mongodb.sln,举行编译,会陆续报错,在相应目录执行如下语句
a、D:\work\mongodb-src-r2.4.8\src\mongo\base>generate_error_codes.py error_codes.err error_codes.h error_codes.cpp
b、D:\work\mongodb-src-r2.4.8\src\mongo\db\auth>generate_action_types.py action_types.txt action_type.h action_type.cpp
c、D:\work\mongodb-src-r2.4.8\src\mongo\db\fts>generate_stop_words.py stop_words_danish.txt stop_words_dutch.txt stop_words_english.txt stop_words_finnish.txt stop_words_french.txt st
op_words_german.txt stop_words_hungarian.txt stop_words_italian.txt stop_words_list.h stop_words_list.cpp
op_words_german.txt stop_words_hungarian.txt stop_words_italian.txt stop_words_list.h stop_words_list.cpp
3、用如下代码段替换stop_words_list.cpp文件的words[]变量初始化代码
const char * const words[] = { "// stop_words.h" , "" , "/**" , "* Copyright (C) 2012 10gen Inc." , "*" , "* This program is free software: you can redistribute it and/or modify" , "* it under the terms of the GNU Affero General Public License, version 3," , "* as published by the Free Software Foundation." , "*" , "* This program is distributed in the hope that it will be useful," , "* but WITHOUT ANY WARRANTY; without even the implied warranty of" , "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" , "* GNU Affero General Public License for more details." , "*" , "* You should have received a copy of the GNU Affero General Public License" , "* along with this program. If not, see <http://www.gnu.org/licenses/>." , "*/" , "" , "" , "#pragma once" , "" , "#include <set>" , "#include <string>" , "" , "#include \"mongo/platform/unordered_set.h\"" , "" , "namespace mongo {" , "" , "namespace fts {" , "" , "class StopWords {" , "public:" , "StopWords();" , "StopWords( const std::set<std::string>& words );" , "" , "void loadStopWordMap( std::map< std::string, std::set< std::string > >* m ){}" , "" , "bool isStopWord( const std::string& word ) const {" , "return _words.count( word ) > 0;" , "}" , "" , "size_t numStopWords() const { return _words.size(); }" , "" , "static const StopWords* getStopWords( const std::string& langauge );" , "private:" , "~StopWords(){}" , "unordered_set<std::string> _words;" , "};" , "" , "}" , "}" , "" , };
4、添加 dbhash.h,dbhash.cpp两个文件加入编译
5、设置命令参数:--dbpath D:\work\data,开启断点,系统成功初始化
相关推荐
VS2010C++下编译调试MongoDB源码.pdf
VS2010C++下编译调试MongoDB源码[归纳].pdf
解压压缩包后,只要运行install.sh,自动将mongodb驱动安装完整
mongodb3.1.3的源码,很干净的源码!! 可编译通过!
本资源使用vs2017编译的mongodb-cxx-driver-r3.6.2,里面包括相关源码,以及使用cmake编译的工程,同时写了一个测试工程,能够对mongodb数据库进行简单的操作。
mongodb2.4.1数据库c++源代码,vs.net项目编译。
看不到源码 MongoDB-Gremlin MongoDB-Gremlin 将 MongoDB 和文档编译为字节码。 在这样做时,JSON 文档被嵌入到底层启用的图形系统中。 该项目目前用作概念验证,不应用于任何实际的生产能力。 创建它是为了为文章...
源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是...
在脚本中编译的一些 MongoDB 查询..如何运行脚本/秒: 运行 mongoDB 服务器: mongod --port 27017 导入json文档: mongoimport -db testing --collection people res/people.json --jsonArray 在本地运行脚本: ...
一如其简约而不简单的MySQL一样,安装起来也非常方便,支持源码编译安装,rpm安装以及yum安装等众多方式。本文主要讲述在CentOS 7下用yum方式快速安装MongoDB的方法,下面来一起看看吧。 一、安装环境及配置yum # ...
项目源码:chat-vue-node 主要技术: vue2全家桶 + socket.io + node(express) + mongodb(mongoose) 环境配置: 需安装配置好 node,mongodb环境(参考://www.jb51.net/article/109449.htm); 建议安装 Robomogo ...
《左手MongoDB,右手Redis——从入门到商业实战》背后的故事。 这篇文章没有代码,请放心阅读。 一个程序员的一生应该这样度过:当她回首往事的时候,她不会因为建造环境浪费时间而悔恨,也不会因为浪费而无法这样,...
本软件使用c#编写,是SQL转存MongoDB的工具,可独立运行,也可定时运行,利用sql数据库时间戳字段进行更新采集区分。 本软件综合了,windows服务控制(安装卸载等),windows服务启动程序(服务控制定时运行程序),...
本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何...
本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何...
项目概述 项目名称:学生成绩管理系统 开发涉及:Node、Vue、MongoDB、...编译方式可自行选择:vscode编译器、cmd窗口 数据库文件:student_score.sql 可自行导入本地数据库 安装依赖:npm install 运行服务:npm start
mongodb3 这是一套将dropbear从头开始打包成DroboApp的脚本,即下载源码、解包、编译、安装、打包成TGZ文件。 master分支包含 Drobo5N 版本, drobofs分支包含 DroboFS 版本。我只想安装 DroboApp,我该怎么办? ...
build-base(编译环境) es 基巴纳 Influxdb 格拉那 卡夫卡 动物园管理员 MySQL的 mongodb Redis 记忆快取 吉蒂亚 亚皮 安装 git clone cd docker_centos && git子模块更新--init --recursive 使用 搭建通用...