Hi, I'm following the instructions on the mongo web site and I run "scons mongoclient", but this is what I'm getting:
scons: Reading SConscript files ... Checking for C++ library boost_thread-mt... (cached) no Checking for C++ library boost_thread... (cached) no Checking for C++ library boost_filesystem-mt... (cached) no Checking for C++ library boost_filesystem... (cached) no Checking for C++ library boost_system-mt... (cached) no Checking for C++ library boost_system... (cached) no scons: done reading SConscript files. scons: Building targets ... cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc /O2 /TP / nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc /Ibuild\mongo /Isr c\mongo 'cl' is not recognized as an internal or external command, operable program or batch file. scons: *** [build\mongo\bson\oid.obj] Error 1 scons: building terminated because of errors.
The path is set, because if I type cl in that folder it comes up with: cl Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ]
Hi Mick,
scons doesn't use the PATH variable to find the compiler (the MongoDB SConstruct doesn't import the PATH variable into its internal environment).
Do you have Visual Studio installed in an unusual place?
-Eric
> Hi,
> I'm following the instructions on the mongo web site and I run "scons mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ...
> Checking for C++ library boost_thread-mt... (cached) no
> Checking for C++ library boost_thread... (cached) no
> Checking for C++ library boost_filesystem-mt... (cached) no
> Checking for C++ library boost_filesystem... (cached) no
> Checking for C++ library boost_system-mt... (cached) no
> Checking for C++ library boost_system... (cached) no
> scons: done reading SConscript files.
> scons: Building targets ...
> cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc /O2 /TP /
> nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc /Ibuild\mongo /Isr
> c\mongo
> 'cl' is not recognized as an internal or external command,
> operable program or batch file.
> scons: *** [build\mongo\bson\oid.obj] Error 1
> scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with:
> cl
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
> Copyright (C) Microsoft Corporation. All rights reserved.
> usage: cl [ option... ] filename... [ /link linkoption... ]
> Please help.
> Thank you in advance :)
> -- > You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/eBiu8r1kckUJ.
> To post to this group, send email to mongodb-dev@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.
On Wednesday, October 24, 2012 12:13:57 PM UTC-7, Eric Milkie wrote: > Hi Mick, > scons doesn't use the PATH variable to find the compiler (the MongoDB > SConstruct doesn't import the PATH variable into its internal environment).
> Do you have Visual Studio installed in an unusual place? > -Eric
> On Oct 24, 2012, at 3:01 PM, Mick wrote:
> Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
> Please help.
> Thank you in advance :)
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-dev" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/mongodb-dev/-/eBiu8r1kckUJ. > To post to this group, send email to mongo...@googlegroups.com<javascript:> > . > To unsubscribe from this group, send email to > mongodb-dev...@googlegroups.com <javascript:>. > For more options, visit this group at > http://groups.google.com/group/mongodb-dev?hl=en.
Which version of scons? The places that it looks for executables is actually built in to scons itself, so it's important to make sure you're on the latest version. If you're all up to date, then the next step is to tell scons to print out debugging info for how it determines where cl.exe is. Or we can just import the PATH by adding a few lines to the SConstruct: http://www.scons.org/wiki/FrequentlyAskedQuestions#Why_doesn.27t_SCon....
I had an older version of Scons, so I got the latest one, and now it comes up with a different error message:
src\mongo/pch.h(48) : fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory scons: *** [build\mongo\bson\oid.obj] Error 2 scons: building terminated because of errors
I haven't moved anything, just downloaded the C++ driver tar from Mongo site, it comes with a boost folder, where should that be so Scons will find the files it needs?
On Thursday, October 25, 2012 10:20:34 AM UTC-7, Eric Milkie wrote: > Which version of scons? The places that it looks for executables is > actually built in to scons itself, so it's important to make sure you're on > the latest version. > If you're all up to date, then the next step is to tell scons to print out > debugging info for how it determines where cl.exe is. Or we can just > import the PATH by adding a few lines to the SConstruct:
> I had an older version of Scons, so I got the latest one, and now it comes up with a different error message:
> src\mongo/pch.h(48) : fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory
> scons: *** [build\mongo\bson\oid.obj] Error 2
> scons: building terminated because of errors
> I haven't moved anything, just downloaded the C++ driver tar from Mongo site, it comes with a boost folder, where should that be so Scons will find the files it needs?
> Thank you.
> On Thursday, October 25, 2012 10:20:34 AM UTC-7, Eric Milkie wrote:
> Which version of scons? The places that it looks for executables is actually built in to scons itself, so it's important to make sure you're on the latest version.
> If you're all up to date, then the next step is to tell scons to print out debugging info for how it determines where cl.exe is. Or we can just import the PATH by adding a few lines to the SConstruct: > http://www.scons.org/wiki/FrequentlyAskedQuestions#Why_doesn.27t_SCon....
> -- > You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/i6juyxYAvaAJ.
> To post to this group, send email to mongodb-dev@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.
On Thursday, October 25, 2012 4:03:10 PM UTC-5, Mick wrote: > I had an older version of Scons, so I got the latest one, and now it comes > up with a different error message:
> src\mongo/pch.h(48) : fatal error C1083: Cannot open include file: > 'boost/shared_ptr.hpp': No such file or directory > scons: *** [build\mongo\bson\oid.obj] Error 2 > scons: building terminated because of errors
> I haven't moved anything, just downloaded the C++ driver tar from Mongo > site, it comes with a boost folder, where should that be so Scons will find > the files it needs?
> Thank you.
> On Thursday, October 25, 2012 10:20:34 AM UTC-7, Eric Milkie wrote:
>> Which version of scons? The places that it looks for executables is >> actually built in to scons itself, so it's important to make sure you're on >> the latest version. >> If you're all up to date, then the next step is to tell scons to print >> out debugging info for how it determines where cl.exe is. Or we can just >> import the PATH by adding a few lines to the SConstruct:
Thank you all for your help, I was finally able to build mongoclient.lib. I'm using C++, VS2008, boost 1_49 and mongo 2.2. However, I added the lib to my project, and now I'm getting these link errors:
On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote: > Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
> Thank you all for your help, I was finally able to build mongoclient.lib. I'm using C++, VS2008, boost 1_49 and mongo 2.2.
> However, I added the lib to my project, and now I'm getting these link errors:
On Monday, October 29, 2012 8:49:47 AM UTC-7, Eric Milkie wrote: > What does your LINK command line look like? > -Eric
> On Oct 29, 2012, at 11:43 AM, Mick <m.d.be...@gmail.com <javascript:>> > wrote:
> > Thank you all for your help, I was finally able to build > mongoclient.lib. I'm using C++, VS2008, boost 1_49 and mongo 2.2. > > However, I added the lib to my project, and now I'm getting these link > errors:
I don't see mongoclient.lib listed explicitly on the command line; are you using #pragma comment to link it in?
From the linker messages, I think you are missing a link to one or more Boost libraries.
-Eric
On Oct 29, 2012, at 12:24 PM, Mick <m.d.berce...@gmail.com> wrote:
Hi Eric, mongoclient.lib is added to the project file, and the boost path is specified in the project properties. That worked fine with the previous version of Mongo that we were using - Mongo 2.0.6. The only thing that changed now is the Mongo version, all the paths are the same.
On Monday, October 29, 2012 10:05:46 AM UTC-7, Eric Milkie wrote: > I don't see mongoclient.lib listed explicitly on the command line; are you > using #pragma comment to link it in? > From the linker messages, I think you are missing a link to one or more > Boost libraries. > -Eric
> On Oct 29, 2012, at 12:24 PM, Mick <m.d.be...@gmail.com <javascript:>> > wrote:
> > I'm using VS2008 to build my project, link command prompt is:
I made some progress, now I'm down to 5 errors and I have no idea what they mean... Has anybody seen these before and does anybody have any idea how to get rid of them? Thank you in advance.
error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall mongo::DBClientWithCommands::getLastError(bool,bool,int,int)" (?getLastError@DBClientWithCommands@mongo@@QAE?AV?$basic_string@DU?$char_tr aits@D@std@@V?$allocator@D@2@@std@@_N0HH@Z) referenced in function "public: unsigned long __thiscall CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
error LNK2019: unresolved external symbol "public: static class mongo::ScopedDbConnection * __cdecl mongo::ScopedDbConnection::getScopedDbConnection(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double)" (?getScopedDbConnection@ScopedDbConnection@mongo@@SAPAV12@ABV?$basic_string @DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N@Z) referenced in function "public: unsigned long __thiscall CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
error LNK2019: unresolved external symbol "void __cdecl mongo::verifyFailed(char const *,char const *,unsigned int)" (?verifyFailed@mongo@@YAXPBD0I@Z) referenced in function "public: virtual class mongo::BSONObjBuilder & __thiscall mongo::BSONObjBuilder::append(class mongo::BSONElement const &)" (?append@BSONObjBuilder@mongo@@UAEAAV12@ABVBSONElement@2@@Z)
error LNK2019: unresolved external symbol "void __cdecl mongo::msgasserted(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?msgasserted@mongo@@YAXHABV?$basic_string@DU?$char_traits@D@std@@V?$alloca tor@D@2@@std@@@Z) referenced in function __catch$?_assertInvalid@BSONObj@mongo@@ABEXXZ$0
error LNK2019: unresolved external symbol "void __cdecl mongo::uasserted(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?uasserted@mongo@@YAXHABV?$basic_string@DU?$char_traits@D@std@@V?$allocato r@D@2@@std@@@Z) referenced in function "public: void __thiscall mongo::BSONElement::toString(class mongo::StringBuilderImpl<class mongo::TrivialAllocator> &,bool,bool,int)const " (?toString@BSONElement@mongo@@QBEXAAV?$StringBuilderImpl@VTrivialAllocator@ mongo@@@2@_N1H@Z)
On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote: > Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
Those symbols should be coming from the mongoclient library. For example, mongo::ScopedDbConnection::getScopedDbConnection() should be coming from connection_factory.cpp, a file that's compiled into the library.
Have you tried linking any of the example files in mongo\src\mongo\client\examples? See if tutorial.cpp or first.cpp links, or if you get similar missing symbol errors.
-Eric
On Oct 29, 2012, at 6:40 PM, Mick <m.d.berce...@gmail.com> wrote:
> I made some progress, now I'm down to 5 errors and I have no idea what they mean... > Has anybody seen these before and does anybody have any idea how to get rid of them?
> Thank you in advance.
> error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall mongo::DBClientWithCommands::getLastError(bool,bool,int,int)" (?getLastError@DBClientWithCommands@mongo@@QAE?AV?$basic_string@DU?$char_tr aits@D@std@@V?$allocator@D@2@@std@@_N0HH@Z) referenced in function "public: unsigned long __thiscall CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
> error LNK2019: unresolved external symbol "public: static class mongo::ScopedDbConnection * __cdecl mongo::ScopedDbConnection::getScopedDbConnection(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double)" (?getScopedDbConnection@ScopedDbConnection@mongo@@SAPAV12@ABV?$basic_string @DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N@Z) referenced in function "public: unsigned long __thiscall CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
> error LNK2019: unresolved external symbol "void __cdecl mongo::verifyFailed(char const *,char const *,unsigned int)" (?verifyFailed@mongo@@YAXPBD0I@Z) referenced in function "public: virtual class mongo::BSONObjBuilder & __thiscall mongo::BSONObjBuilder::append(class mongo::BSONElement const &)" (?append@BSONObjBuilder@mongo@@UAEAAV12@ABVBSONElement@2@@Z)
> error LNK2019: unresolved external symbol "void __cdecl mongo::msgasserted(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?msgasserted@mongo@@YAXHABV?$basic_string@DU?$char_traits@D@std@@V?$alloca tor@D@2@@std@@@Z) referenced in function __catch$?_assertInvalid@BSONObj@mongo@@ABEXXZ$0
> error LNK2019: unresolved external symbol "void __cdecl mongo::uasserted(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?uasserted@mongo@@YAXHABV?$basic_string@DU?$char_traits@D@std@@V?$allocato r@D@2@@std@@@Z) referenced in function "public: void __thiscall mongo::BSONElement::toString(class mongo::StringBuilderImpl<class mongo::TrivialAllocator> &,bool,bool,int)const " (?toString@BSONElement@mongo@@QBEXAAV?$StringBuilderImpl@VTrivialAllocator@ mongo@@@2@_N1H@Z)
On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote: > Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
These are some new function calls we've added recently to support stack traces when things go wrong -- sorry we haven't updated the docs. Add DbgHelp.lib to your link list and that should solve these.
-Eric
On Oct 30, 2012, at 3:30 PM, Mick <m.d.berce...@gmail.com> wrote:
> Thank you for your help, Eric, I got past those errors.
> Unfortunately now I get a different set:
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymCleanup@4 referenced in function "void __cdecl mongo::printWindowsStackTrace(struct _CONTEXT &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?printWindowsStackTrace@mongo@@YAXAAU_CONTEXT@@AAV?$basic_ostream@DU?$char _traits@D@std@@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__StackWalk64@36 referenced in function "void __cdecl mongo::printWindowsStackTrace(struct _CONTEXT &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?printWindowsStackTrace@mongo@@YAXAAU_CONTEXT@@AAV?$basic_ostream@DU?$char _traits@D@std@@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymSetOptions@4 referenced in function "void __cdecl mongo::printWindowsStackTrace(struct _CONTEXT &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?printWindowsStackTrace@mongo@@YAXAAU_CONTEXT@@AAV?$basic_ostream@DU?$char _traits@D@std@@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymGetOptions@0 referenced in function "void __cdecl mongo::printWindowsStackTrace(struct _CONTEXT &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?printWindowsStackTrace@mongo@@YAXAAU_CONTEXT@@AAV?$basic_ostream@DU?$char _traits@D@std@@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymInitialize@12 referenced in function "void __cdecl mongo::printWindowsStackTrace(struct _CONTEXT &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?printWindowsStackTrace@mongo@@YAXAAU_CONTEXT@@AAV?$basic_ostream@DU?$char _traits@D@std@@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymGetModuleInfo64@16 referenced in function "void __cdecl mongo::getModuleName(void *,unsigned __int64,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?getModuleName@mongo@@YAXPAX_KPAV?$basic_string@DU?$char_traits@D@std@@V?$ allocator@D@2@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymGetLineFromAddr64@20 referenced in function "void __cdecl mongo::getSourceFileAndLineNumber(void *,unsigned __int64,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?getSourceFileAndLineNumber@mongo@@YAXPAX_KPAV?$basic_string@DU?$char_trai ts@D@std@@V?$allocator@D@2@@std@@@Z)
> 1>mongoclientd.lib(stacktrace.obj) : error LNK2019: unresolved external symbol __imp__SymFromAddr@20 referenced in function "void __cdecl mongo::getsymbolAndOffset(void *,unsigned __int64,struct _SYMBOL_INFO *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?getsymbolAndOffset@mongo@@YAXPAX_KPAU_SYMBOL_INFO@@PAV?$basic_string@DU?$ char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote:
> Hi,
> I'm following the instructions on the mongo web site and I run "scons mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ...
> Checking for C++ library boost_thread-mt... (cached) no
> Checking for C++ library boost_thread... (cached) no
> Checking for C++ library boost_filesystem-mt... (cached) no
> Checking for C++ library boost_filesystem... (cached) no
> Checking for C++ library boost_system-mt... (cached) no
> Checking for C++ library boost_system... (cached) no
> scons: done reading SConscript files.
> scons: Building targets ...
> cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc /O2 /TP /
> nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc /Ibuild\mongo /Isr
> c\mongo
> 'cl' is not recognized as an internal or external command,
> operable program or batch file.
> scons: *** [build\mongo\bson\oid.obj] Error 1
> scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with:
> cl
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
> Copyright (C) Microsoft Corporation. All rights reserved.
> usage: cl [ option... ] filename... [ /link linkoption... ]
> Please help.
> Thank you in advance :)
> -- > You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/33mBEaebzYgJ.
> To post to this group, send email to mongodb-dev@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.
1> c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(460) : see previous definition of 'AF_IPX' The list is long, but you get the jist of it... Any ideas what might have happened? Thanks again.
On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote: > Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
This looks like include file conflicts. Be sure to include only dbclient.h in your code, no other MongoDB headers, and be sure to include it before any other #include lines in your source file. Also, within dbclient.h we include <windows.h> and define WIN32_LEAN_AND_MEAN as well (this is not ideal, and we will fix this in a later MongoDB version), but for now, you will need to avoid including windows.h in any source file that includes dbclient.h. I think this is why you are getting ws2def.h errors - you may be including windows.h after dbclient.h?
-Eric
On Oct 30, 2012, at 3:53 PM, Mick <m.d.berce...@gmail.com> wrote:
> Thank you, Eric, that fixed those link errors :)
> Now another dependent project - that remained unchanged - is giving me
> \bson\bsonelement.h(630) : warning C4003: not enough actual parameters for macro 'max'
> \bson\bsonelement.h(630) : error C2589: '(' : illegal token on right side of '::'
> 1> c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(460) : see previous definition of 'AF_IPX'
> The list is long, but you get the jist of it... Any ideas what might have happened? > Thanks again.
> On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote:
> Hi,
> I'm following the instructions on the mongo web site and I run "scons mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ...
> Checking for C++ library boost_thread-mt... (cached) no
> Checking for C++ library boost_thread... (cached) no
> Checking for C++ library boost_filesystem-mt... (cached) no
> Checking for C++ library boost_filesystem... (cached) no
> Checking for C++ library boost_system-mt... (cached) no
> Checking for C++ library boost_system... (cached) no
> scons: done reading SConscript files.
> scons: Building targets ...
> cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc /O2 /TP /
> nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc /Ibuild\mongo /Isr
> c\mongo
> 'cl' is not recognized as an internal or external command,
> operable program or batch file.
> scons: *** [build\mongo\bson\oid.obj] Error 1
> scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with:
> cl
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
> Copyright (C) Microsoft Corporation. All rights reserved.
> usage: cl [ option... ] filename... [ /link linkoption... ]
> Please help.
> Thank you in advance :)
> -- > You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/4UxAvTObkdQJ.
> To post to this group, send email to mongodb-dev@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.
Hi Eric, I have a solution with 6 projects, of which one communicates with Mongo database. The other projects call functions from this one dll. Now dll compiles and links fine, thanks to your suggestions, but I'm getting all these compile errors in 2 of the projects that I did not touch... I'm confused about the bsonelement.h warnings and errors, because that's part of the mongo source files. Any ideas why I'm getting those?
On Tuesday, October 30, 2012 12:59:41 PM UTC-7, Eric Milkie wrote: > This looks like include file conflicts. Be sure to include only > dbclient.h in your code, no other MongoDB headers, and be sure to include > it before any other #include lines in your source file. Also, within > dbclient.h we include <windows.h> and define WIN32_LEAN_AND_MEAN as well > (this is not ideal, and we will fix this in a later MongoDB version), but > for now, you will need to avoid including windows.h in any source file that > includes dbclient.h. I think this is why you are getting ws2def.h errors - > you may be including windows.h after dbclient.h? > -Eric
> On Oct 30, 2012, at 3:53 PM, Mick <m.d.be...@gmail.com <javascript:>> > wrote:
> Thank you, Eric, that fixed those link errors :) > Now another dependent project - that remained unchanged - is giving me
> \bson\bsonelement.h(630) : warning C4003: not enough actual parameters for > macro 'max'
> \bson\bsonelement.h(630) : error C2589: '(' : illegal token on right side > of '::'
> 1> c:\program files\microsoft sdks\windows\v6.0a\include\winsock.h(460) : > see previous definition of 'AF_IPX' > The list is long, but you get the jist of it... Any ideas what might have > happened? > Thanks again.
> On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote:
>> Hi, >> I'm following the instructions on the mongo web site and I run "scons >> mongoclient", but this is what I'm getting:
>> scons: Reading SConscript files ... >> Checking for C++ library boost_thread-mt... (cached) no >> Checking for C++ library boost_thread... (cached) no >> Checking for C++ library boost_filesystem-mt... (cached) no >> Checking for C++ library boost_filesystem... (cached) no >> Checking for C++ library boost_system-mt... (cached) no >> Checking for C++ library boost_system... (cached) no >> scons: done reading SConscript files. >> scons: Building targets ... >> cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc >> /O2 /TP / >> nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc >> /Ibuild\mongo /Isr >> c\mongo >> 'cl' is not recognized as an internal or external command, >> operable program or batch file. >> scons: *** [build\mongo\bson\oid.obj] Error 1 >> scons: building terminated because of errors.
>> The path is set, because if I type cl in that folder it comes up with: >> cl >> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 >> for 80x86 >> Copyright (C) Microsoft Corporation. All rights reserved. >> usage: cl [ option... ] filename... [ /link linkoption... ]
>> Please help.
>> Thank you in advance :)
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-dev" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/mongodb-dev/-/4UxAvTObkdQJ. > To post to this group, send email to mongo...@googlegroups.com<javascript:> > . > To unsubscribe from this group, send email to > mongodb-dev...@googlegroups.com <javascript:>. > For more options, visit this group at > http://groups.google.com/group/mongodb-dev?hl=en.
The only way you could be getting those compilation errors in MongoDB headers is if you are #including them in your source files. If you don't immediately see where it's coming from, you can try preprocessing one of the files; that should show you the include chain.
-Eric
Thank you, Eric, your help is highly appreciated. However, we're going to stick with the Mongo 2.0.6, the upgrade is taking way too long. Might try again at a later date, time permitting...
On Tuesday, October 30, 2012 4:57:45 PM UTC-7, Eric Milkie wrote: > The only way you could be getting those compilation errors in MongoDB > headers is if you are #including them in your source files. If you don't > immediately see where it's coming from, you can try preprocessing one of > the files; that should show you the include chain. > -Eric
I am facing same Linker issues you mentioned in you post below. You mentioned that you could get beyond them in you next post on this thread. Could you tell me how? I am referencing to an external boost while building mongoclient.lib. I am using msvc11 and building using scons.
On Monday, October 29, 2012 6:40:31 PM UTC-4, Mick wrote:
> I made some progress, now I'm down to 5 errors and I have no idea what > they mean... > Has anybody seen these before and does anybody have any idea how to get > rid of them? > Thank you in advance.
> error LNK2019: unresolved external symbol "public: class > std::basic_string<char,struct std::char_traits<char>,class > std::allocator<char> > __thiscall > mongo::DBClientWithCommands::getLastError(bool,bool,int,int)" > (?getLastError@DBClientWithCommands@mongo@@QAE?AV?$basic_string@DU?$char_tr aits@D@std@@V?$allocator@D@2@@std@@_N0HH@Z) > referenced in function "public: unsigned long __thiscall > CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
> error LNK2019: unresolved external symbol "public: static class > mongo::ScopedDbConnection * __cdecl > mongo::ScopedDbConnection::getScopedDbConnection(class > std::basic_string<char,struct std::char_traits<char>,class > std::allocator<char> > const &,double)" > (?getScopedDbConnection@ScopedDbConnection@mongo@@SAPAV12@ABV?$basic_string @DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N@Z) > referenced in function "public: unsigned long __thiscall > CArcDBComm::Initialize(void)" (?Initialize@CArcDBComm@@QAEKXZ)
> error LNK2019: unresolved external symbol "void __cdecl > mongo::verifyFailed(char const *,char const *,unsigned int)" > (?verifyFailed@mongo@@YAXPBD0I@Z) referenced in function "public: virtual > class mongo::BSONObjBuilder & __thiscall > mongo::BSONObjBuilder::append(class mongo::BSONElement const &)" > (?append@BSONObjBuilder@mongo@@UAEAAV12@ABVBSONElement@2@@Z)
> error LNK2019: unresolved external symbol "void __cdecl > mongo::msgasserted(int,class std::basic_string<char,struct > std::char_traits<char>,class std::allocator<char> > const &)" > (?msgasserted@mongo@@YAXHABV?$basic_string@DU?$char_traits@D@std@@V?$alloca tor@D@2@@std@@@Z) > referenced in function __catch$?_assertInvalid@BSONObj@mongo@@ABEXXZ$0
> On Wednesday, October 24, 2012 12:01:12 PM UTC-7, Mick wrote:
>> Hi, >> I'm following the instructions on the mongo web site and I run "scons >> mongoclient", but this is what I'm getting:
>> scons: Reading SConscript files ... >> Checking for C++ library boost_thread-mt... (cached) no >> Checking for C++ library boost_thread... (cached) no >> Checking for C++ library boost_filesystem-mt... (cached) no >> Checking for C++ library boost_filesystem... (cached) no >> Checking for C++ library boost_system-mt... (cached) no >> Checking for C++ library boost_system... (cached) no >> scons: done reading SConscript files. >> scons: Building targets ... >> cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc >> /O2 /TP / >> nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc >> /Ibuild\mongo /Isr >> c\mongo >> 'cl' is not recognized as an internal or external command, >> operable program or batch file. >> scons: *** [build\mongo\bson\oid.obj] Error 1 >> scons: building terminated because of errors.
>> The path is set, because if I type cl in that folder it comes up with: >> cl >> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 >> for 80x86 >> Copyright (C) Microsoft Corporation. All rights reserved. >> usage: cl [ option... ] filename... [ /link linkoption... ]
Could you please post the exact link errors you are seeing, along with
information about which version of the C++ driver you are using?
Information on the OS and compiler revision would be very useful as well.
It will be easier to diagnose this way rather than referring back to errors
from a much earlier thread.
Thanks for your response. I have attached a txt file containing the linker errors. I checked out mongo from the github master branch yesterday so it must be the latest development. I am trying to build a 32 bit version on Win 7 64 bit. I used the msvc11 to build boost_1_53_0 and build the mongo with --extrapath=1_53_0_BoostLibraryPath I used scons to build the mongoclient.lib. The toolset is msvc11 again.
Let me know,
Best,
Pravish
From Andrew: Could you please post the exact link errors you are seeing, along with information about which version of the C++ driver you are using? Information on the OS and compiler revision would be very useful as well. It will be easier to diagnose this way rather than referring back to errors from a much earlier thread.
On Wednesday, October 24, 2012 3:01:12 PM UTC-4, Mick wrote:
> Hi, > I'm following the instructions on the mongo web site and I run "scons > mongoclient", but this is what I'm getting:
> scons: Reading SConscript files ... > Checking for C++ library boost_thread-mt... (cached) no > Checking for C++ library boost_thread... (cached) no > Checking for C++ library boost_filesystem-mt... (cached) no > Checking for C++ library boost_filesystem... (cached) no > Checking for C++ library boost_system-mt... (cached) no > Checking for C++ library boost_system... (cached) no > scons: done reading SConscript files. > scons: Building targets ... > cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /nologo /EHsc > /O2 /TP / > nologo /EHsc /O2 /D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc > /Ibuild\mongo /Isr > c\mongo > 'cl' is not recognized as an internal or external command, > operable program or batch file. > scons: *** [build\mongo\bson\oid.obj] Error 1 > scons: building terminated because of errors.
> The path is set, because if I type cl in that folder it comes up with: > cl > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 > for 80x86 > Copyright (C) Microsoft Corporation. All rights reserved. > usage: cl [ option... ] filename... [ /link linkoption... ]
Hi Pravish, Can you show the compilation and link command lines you're using? I suspect you're not using the same calling standard for everything. When I compare your missing symbols to the ones present in the library, they are mangling differently. You should be using /MT or /MTd when you compile foo.cpp, to match how scons is compiling the C++ driver files. -Eric