My setup:
Windows XP x86
Visual Studio 2010 Express
Python2.7
Scons 2.1
Boost 1.47 binary dist from
http://www.boostpro.com/download/
mongoDB win32-i386-2.0.6-rc0
I downloaded cxx-driver/mongodb-linux-x86_64-2.1.1.tgz from
http://dl.mongodb.org/dl/cxx-driver/ and built it successfully with
some effort (e.g. adding boost dependencies, defining UNICODE in
SConstruct..)
The build process of c++ driver looks like this:
============= Build driver OK ==========================
....
timer.cpp
cl /Fobuild\mongo\util\trace.obj /c src\mongo\util\trace.cpp /TP /
nologo /EHsc /
O2 /D_SCONS /DMONGO_EXPOSE_MACROS /D_UNICODE /DUNICODE /Ibuild /Isrc /
Ibuild\mon
go /Isrc\mongo "/IC:\Program Files\boost\boost_1_47\include" "/IC:
\Program Files
\boost\boost_1_47"
....
Install file: "build\mongoclient.lib" as "mongoclient.lib"
scons: done building targets.
====================================================
Then I try to write my first test in VC10 Express but I got the
strange error.
============== Build client test failed =====================
1>mongoclient.lib(dbclient.obj) : error LNK2038: mismatch detected for
'_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in
MyApp.obj
.....
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Container_base12::~_Container_base12(void)" (??
1_Container_base12@std@@QAE@XZ) already defined in
mongoclient.lib(dbclient.obj)
.....
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of
other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of
other libs; use /NODEFAULTLIB:library
1>mongoclient.lib(sock.obj) : error LNK2019: unresolved external
symbol __imp__inet_addr@4 referenced in function
_WspiapiParseV4Address@8
....
===================================================
My VC 10 Express project setting looks something like this
=============== MyApp.vcxproj ========================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://
schemas.microsoft.com/developer/msbuild/2003">
....
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%
(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>\path\to\mongo-cxx-
driver-2.1.1\build</AdditionalLibraryDirectories>
<AdditionalDependencies>mongoclient.lib;boost_thread-vc100-
mt-1_47.lib;boost_filesystem-vc100-
mt-1_47.lib;libboost_program_options-vc100-mt-1_47.lib</
AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$
(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>\path\to\mongo-cxx-
driver-2.1.1\src;\path\yo\mongo-cxx-driver-2.1.1\src\mongo;%
(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
........
</Project>
==================================================
thanks a lot for any help :P
Best Regards