cannot find dbclient.h

537 views
Skip to first unread message

Isaac Chen

unread,
Mar 25, 2015, 12:39:01 AM3/25/15
to mongod...@googlegroups.com
my system 
===========================================================================================
ubuntu 14.04 
python 2.7.6
mongo 2.4.9
git 1.9.1
SCons by Steven Knight et al.:
script: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep
engine: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep
engine path: ['/usr/lib/scons/SCons']
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
boost 1.54.0.1ubuntu1
===========================================================================================
the following step that I did
cd ~/
git clone g...@github.com:mongodb/mongo-cxx-driver.git
cd mongo-cxx-driver
sudo scons install
cd src/mongo/client/examples
sudo g++ tutorial.cpp -I/usr/local/include/mongo -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -o tutorial

And I get this error message:
sudo: unable to resolve host star
tutorial.cpp:25:35: fatal error: mongo/client/dbclient.h: no such file or folder
 #include "mongo/client/dbclient.h"
Not sure what the problem I get? I may apologize first I know few about the system, so there may exist some hints that I did not get
If Official could help that would be nice, thanks!

Andrew Morrow

unread,
Mar 25, 2015, 8:35:06 AM3/25/15
to mongod...@googlegroups.com

Hi -

By default 'scons install' doesn't install to /usr/local, it installs to a subdirectory of the source tree called 'build/install'. If you want to install to /usr/local, you should explicitly request that by passing --prefix=/usr/local to SCons. Once you have installed to /usr/local, your command line to build the tutorial should work.

Also, you shouldn't need to include 'mongo' at the end of the argument to -I, since the tutorial program already qualifies its includes with the 'mongo' name.

Please let me know if you need any additional help.

Thanks,
Andrew



--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/4068b3b7-a2e6-4c92-80d3-eed44294dfee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Isaac Chen

unread,
Mar 30, 2015, 12:39:33 AM3/30/15
to mongod...@googlegroups.com
Thanks Andrew

I took your advice and gave the command line below

sudo scons --prefix=/usr/local install
 I always get this error below

 Checking whether the C++ compiler works(cached) yes
Checking whether the C compiler works(cached) yes
Checking if C++ compiler "g++" is GCC... (cached) yes
Checking if C compiler "gcc" is GCC... (cached) yes
Checking if C compiler supports -Wno-unused-local-typedefs... (cached) yes
Checking if C compiler supports -Wno-unused-function... (cached) yes
Checking if C compiler supports -Wno-unused-private-field... (cached) no
Checking if C compiler supports -Wno-deprecated-declarations... (cached) yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... (cached) no
Checking if C compiler supports -Wno-unused-const-variable... (cached) no
Checking if C compiler supports -Wno-missing-braces... (cached) yes
Checking if we are using libstdc++... (cached) yes
Checking for libstdc++ 4.6.0 or better... (cached) yes
Checking if C++ compiler supports -std=c++11... yes
Checking if C compiler supports -std=c99... yes
Checking if we are on a POSIX system... yes
Checking if the POSIX monotonic clock is supported... yes
Checking for __thread... yes
Checking for C++11 <atomic> support... yes
Checking for C++11 is_trivially_copyable support... no
Checking for C++ header file boost/version.hpp... yes
Checking for C++ library boost_regex-mt... no
Checking for C++ library boost_regex... yes
Checking for C++ library boost_thread-mt... no
Checking for C++ library boost_thread... yes
Checking for C++ library boost_system-mt... no
Checking for C++ library boost_system... yes
Checking for C header file unistd.h... yes
Checking for C library rt... yes
Checking whether timegm is declared... (cached) no
Checking whether strnlen is declared... (cached) no
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 1. 9 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 2. 8 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 3. 7 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 4. 6 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 5. 5 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 6. 4 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 7. 3 attempts remaining...
Cannot connect to Mongo Orchestration at localhost:8889 on attempt 8. 2 attempts remaining...

Not sure what's going on with these mistakes
Or it won't bother?

thx

Andrew Morrow

unread,
Mar 30, 2015, 10:14:51 AM3/30/15
to mongod...@googlegroups.com

Hi -

The highlighted lines are normal and do not suggest any problem building the driver. Was /usr/local populated with the artifacts you would expect from a complete build (e.g. /usr/local/include/mongo exists and has files in it, and /usr/local/lib/libmongoclient.a was created)?

Thanks,
Andrew


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.

Isaac Chen

unread,
Mar 30, 2015, 10:48:40 PM3/30/15
to mongod...@googlegroups.com
It worked!!!
Thank you so MUCH!
I compile with this command
g++ tutorial.cpp -pthread -lmongoclient -lboost_thread -lboost_system -lboost_regex -o tutorial

btw, those file you mentioned were found!thx

acm於 2015年3月30日星期一 UTC+8下午10時14分51秒寫道:
Reply all
Reply to author
Forward
0 new messages