libmongodbclient 2.6.6

mongodb c++ driver 2.6之后的版本不能从mongdb的源码中编译,已经分离到独立的地方:
https://github.com/mongodb/mongo-cxx-driver/wiki


编译64位的:
1. 打开vs 64位工具
2. scons --use-system-boost --prefix=F:\kevin\Downloads\mongodb_new\mongo-cxx-driver-legacy-0.0-26compat-2.6.6\install\ --release --64=FORCE64 --libpath=F:\CardMatch_Mongo_2.2.2\CardMatch_v4.3_3922_5_1\CardMatch_v4.3_3933_5\lib64\release\boost --cpppath=F:\CardMatch_Mongo_2.2.2\CardMatch_v4.3_3922_5_1\CardMatch_v4.3_3933_5\include64\ --static --opt=on --full install


错误解决:
stdaf.h中需要调整_WIN32_WINNT的值
#define _WIN32_WINNT 0x0502 // 将此值更改为相应的值,以适用于 Windows 的其他版本。

不过使用时会出现链接错误:
Error 880 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class mongo::Query & __cdecl mongo::Query::operator=(class mongo::Query const &)" (__imp_??4Query@mongo@@QEAAAEAV01@AEBV01@@Z) ***.obj

猜你喜欢

转载自huaxiamian.iteye.com/blog/2186605