Google Groups

Re: C++ 32-bit driver


Tad Marshall May 8, 2012 7:43 AM
Posted in group: mongodb-user
We had this problem in our 2.1 version and a contributor gave us a patch for it.  If using the latest source code works for you, you could just switch to using the current master branch from GitHub and the --32 switch will do the right thing in Windows.

If you want to stay with the 2.0 source code, you could try making the changes yourself based on the patch.  The GitHub commit that fixed it for version 2.1 is


You will likely be happier with the state of the C++ driver in the 2.1 code.  We've done a lot of work to make it a more standalone bit of code (it doesn't drag in as much of MongoDB itself when you link with it) and you could use the 2.1 C++ driver code to communicate with a 2.0 version of the database.  If you want to try making the changes to the 2.0 SConstruct, I think the main thing is to make sure that "x86" gets passed to the scons build rule so that it doesn't default to "your current OS's default".

On Tuesday, May 8, 2012 4:01:49 AM UTC-4, Maliha wrote:
Hi,

I need to build the 32-bit c++ driver, but scons always builds the 64-
bit version. I have downloaded the full MongoDB source code (version:
2.0.4) and am building the driver only; I am using VS 2010 on 64-bit
Windows 7.

Even when I run "scons --32 mongoclient.lib" I get a 64-bit library. I
checked the file header with dumpbin command. Here is the partial
output from command "dumpbin mongoclient.lib /HEADERS":

"FILE HEADER VALUES
            8664 machine (x64)"

How can I build the 32-bit c++ driver?

Thanks!