Re: [mongodb-user] Re: building C++ driver on Windows

192 views
Skip to first unread message

Michael Schuitema

unread,
May 14, 2012, 11:56:37 AM5/14/12
to mongod...@googlegroups.com, mongo...@googlegroups.com
hi Eric,

All I can find in terms of boost in the SConstruct file is: 

boostLibs = [ "thread" , "filesystem" , "system", "thread" ]
conf = Configure(env)
for lib in boostLibs:
    if not conf.CheckLib("boost_%s-mt" % lib):
        conf.CheckLib("boost_%s" % lib)

I copied boost to E:\boost\ (meaning eg. E:\boost\boost\lambda ), but still no luck. Am I using the correct Sconstruct file?



On Mon, May 14, 2012 at 3:54 PM, Eric Milkie <mil...@10gen.com> wrote:
Hi Mike,
In the SConstruct file's find_boost() function, it looks for boost in "C:\Program Files\boost\latest" and "C:\Program Files\Boost\boost_1_[x]", and in C:\boost, and in \boost (using the current drive).
In version 2.1.0 and greater, we've greatly improved this situation and have included boost 1.49 in the mongo source tree; but for your version of MongoDB, you will need to supply a version of boost in one of the above directories. We have some prebuilt boost libraries available; see http://www.mongodb.org/display/DOCS/Boost+and+Windows
For further assistance, there is a group mongodb-dev -- we deal with building/compiling issues there.
"--release" ought to work -- are you using the latest version of scons?
-Eric




On Monday, May 14, 2012 10:30:48 AM UTC-4, Mike wrote:
Hi, I am a new user of mongodb. I managed to install mongodb (2.0.5)
successfully on a linux server. Now I would like to use it in a 32bit
windows client. As there do not appear to be any binaries for this, I
downloaded mongodb-linux-x86_64-v2.0-latest.tgz from
http://dl.mongodb.org/dl/cxx-driver/. I have scons installed and boost
on my machine. I tried running

scons --release mongoclient.lib

however, it cannot find my boost libraries and complains about no such
option: --release

1) How do I inform scons of where my boost libraries are?
2) Anyone managed to build a lib with Visual Studio 2010 express?

Cheers, Mike

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Eric Milkie

unread,
May 14, 2012, 12:32:06 PM5/14/12
to mongo...@googlegroups.com
Whoops, I was looking at the SConstruct for the entire source tree, not the C++ client distribution.
For the C++ driver, scons just wants to have those four boost libraries in your libpath. Since we don't set the path explicitly, it will not be providing a path to LINK.EXE and the linker will only look in the system locations for libraries.
You can supply --extrapath, which will cause this behavior:
scons --extrapath=c:\boost
(will look in c:\boost\lib and c:\boost\lib64 for libraries)
-Eric

Michael Schuitema

unread,
May 14, 2012, 2:16:15 PM5/14/12
to mongo...@googlegroups.com
I had no luck with the client distribution, but with the latest version from git it worked (at least it compiled, haven't tested it yet). 

I have the latest production release (2.0.5) on my server. Does it matter that I have a different client version? What would be the best source to grab to compile for the production version.

Thanks for your help

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To post to this group, send email to mongo...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.


Eric Milkie

unread,
May 14, 2012, 2:56:05 PM5/14/12
to mongod...@googlegroups.com, mongo...@googlegroups.com
[moved to mongodb-dev]

Andy Schwerin

unread,
May 14, 2012, 3:03:06 PM5/14/12
to mongo...@googlegroups.com
The 2.1.1 version of the C++ client should work with 2.0.5, though we
haven't completed compatibility testing, yet (won't until 2.2 release
testing for mongod). I'd feel pretty good about core functionality
(find*, insert, update, upsert) when talking to a mongos instance or a
particular mongod instance. If you plan to talk to unsharded
replicasets using the ReplSetConnection (that's not quite the name,
I'm guessing), that's something that has changed enough since 2.0, and
you might want to test it before deploying ;)

-Andy

Michael Schuitema

unread,
May 14, 2012, 3:30:30 PM5/14/12
to mongo...@googlegroups.com
Hi,

I am now playing with linking the library to a c++ project. I am a bit confused. I set .../src/mongo as my include directory. I received an error as in dbclient.h it says

#include "mongo/client/redef_macros.h"

so I changed my include directory to .../src but then it complains about 

#include "pch.h" 

which is also in dbclient.h

This seems inconsistent or am I missing something? Thanks.

Eric Milkie

unread,
May 14, 2012, 3:37:29 PM5/14/12
to mongo...@googlegroups.com
It is indeed inconsistent, and was a byproduct of the way we were using precompiled headers on Windows. We want all the pch.h includes to say "mongo/pch.h", and we're slowly moving in that direction. For now, you will need to have both paths as include paths.
-Eric


Reply all
Reply to author
Forward
0 new messages