Compiling on Linux problem

231 views
Skip to first unread message

EiTkoCaT

unread,
Jul 1, 2011, 8:14:16 PM7/1/11
to mongodb-user
Hey,

OK I have a problem. I've downloaded the c++ driver from
http://dl.mongodb.org/dl/cxx-driver. I'm following the
http://www.mongodb.org/pages/viewpage.action?pageId=21266598 but when
I type "scons" it gives me:
/mongo-cxx-driver-v1.8# scons
-bash: scons: command not found

What to do?


Thanks.

Eliot Horowitz

unread,
Jul 1, 2011, 8:15:59 PM7/1/11
to mongod...@googlegroups.com
You need to install scons.
If this is linux, would be either:
apt-get install scons
or
yum install scons

> --
> 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.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

EiTkoCaT

unread,
Jul 1, 2011, 8:24:15 PM7/1/11
to mongodb-user
OK but now it gives me error..:

In file included from mongo/client/../db/cursor.h:23,
from mongo/client/../db/pdfile.h:367,
from mongo/client/../db/db.h:22,
from mongo/client/../db/dbhelpers.h:27,
from mongo/client/clientOnly.cpp:20:
mongo/client/../db/matcher.h:24:21: error: pcrecpp.h: No such file or
directory
In file included from mongo/client/../db/cursor.h:23,
from mongo/client/../db/pdfile.h:367,
from mongo/client/../db/db.h:22,
from mongo/client/../db/dbhelpers.h:27,
from mongo/client/clientOnly.cpp:20:
mongo/client/../db/matcher.h:39: error: 'pcrecpp' was not declared in
this scope
mongo/client/../db/matcher.h:39: error: template argument 1 is invalid
scons: *** [mongo/client/clientOnly.o] Error 1
scons: building terminated because of errors.


On Jul 2, 3:15 am, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> You need to install scons.
> If this is linux, would be either:
> apt-get install scons
> or
> yum install scons
>
>
>
>
>
>
>
> On Fri, Jul 1, 2011 at 8:14 PM, EiTkoCaT <eitko...@gmail.com> wrote:
> > Hey,
>
> > OK I have a problem. I've downloaded the c++ driver from
> >http://dl.mongodb.org/dl/cxx-driver. I'm following the
> >http://www.mongodb.org/pages/viewpage.action?pageId=21266598but when

Eliot Horowitz

unread,
Jul 1, 2011, 8:26:12 PM7/1/11
to mongod...@googlegroups.com
You should follow the instructions here for setting up your environment:
http://www.mongodb.org/display/DOCS/Building+for+Linux

EiTkoCaT

unread,
Jul 2, 2011, 9:26:37 AM7/2/11
to mongodb-user
OK I followed and installed all OK but when I try to compile it gives
me:
/usr/bin/ld: cannot find -lmongoclient
collect2: ld returned 1 exit status

EiTkoCaT

unread,
Jul 2, 2011, 9:30:02 AM7/2/11
to mongodb-user
Also if I'm doing
g++ -I .. simple_client_demo.cpp mongo_client_lib.cpp -lboost_thread-
mt -lboost_filesystem

it gives me some lot of undefined reference to `mongo::OID::init()'
and other functions...

WTF? Thanks.

Eliot Horowitz

unread,
Jul 2, 2011, 9:37:35 AM7/2/11
to mongod...@googlegroups.com

You need -lmongoclient

EiTkoCaT

unread,
Jul 2, 2011, 9:44:05 AM7/2/11
to mongodb-user
Gives me:
/usr/bin/ld: cannot find -lmongoclient
collect2: ld returned 1 exit status


On Jul 2, 4:37 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> You need -lmongoclient

EiTkoCaT

unread,
Jul 2, 2011, 11:05:17 AM7/2/11
to mongodb-user
Well how can I solve that? It drives me crazy!

Nat

unread,
Jul 2, 2011, 11:10:54 AM7/2/11
to mongod...@googlegroups.com
After you build mongoclient, make sure you get it placed in lib location such as /usr/lib, /usr/lib64

EiTkoCaT

unread,
Jul 2, 2011, 11:40:10 AM7/2/11
to mongodb-user
How to build mongoclient? That's exactly my problem!!!

Thanks!

Nat

unread,
Jul 2, 2011, 12:12:46 PM7/2/11
to mongod...@googlegroups.com
If you build it from mongodb source, you can try "scons --full install"
Otherwise, if building from cxx-driver tarball, you can just run "scons" from the extracted directory.

EiTkoCaT

unread,
Jul 2, 2011, 12:29:22 PM7/2/11
to mongodb-user
I already did just "scons". I'm using the cxx-driver.

Nat

unread,
Jul 2, 2011, 8:08:54 PM7/2/11
to mongod...@googlegroups.com
Did you make sure mongoclient.a get copied to /usr/lib or /usr/lib64? 

EiTkoCaT

unread,
Jul 3, 2011, 5:00:59 AM7/3/11
to mongodb-user
OK I've formatted everything, re-installed and works great.

Thanks!
Reply all
Reply to author
Forward
0 new messages