error linking against boost

1,517 views
Skip to first unread message

Freddy Martinez Garcia

unread,
Jul 28, 2014, 12:55:56 AM7/28/14
to mongod...@googlegroups.com
Hi guys… I have spent some days trying to compiling mongo-clien-cxx driver for windows and after some efforts, my compilation doesn’t link well against boost.

I need to say that I’m not a windows user… I’ve installed Visual Studio 2010 and I had compiled the boost using this configuration…

boost files are generated like I show u in the image boost-lib-dir.png

well… the first output of the compilation is:

scons: Reading SConscript files ...
scons version: 2.3.2
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if toolchain is in 64-bit mode... (cached) no
Checking if we are using libstdc++... (cached) no
WARNING: Cannot disable C++11 features when using MSVC
Checking if we are on a POSIX system... (cached) no
Checking for VS 2013 Update 2 or Later... (cached) no
Checking for __declspec(thread)... (cached) yes
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file boost/version.hpp... (cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether timegm is declared... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /DEBUG /INCREMENTAL:NO /OUT:build\win32\normal\arrayExample.exe /LIBPATH:build\win32\normal /LIBPATH:src /LIBPATH:C:\boost\lib ws2_32.lib DbgHelp.lib /PDB:build\win32\normal\arrayExample.pdb /DEBUG build\win32\normal\mongo\client\examples\arrayExample.obj
LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-s-1_55.lib'
scons: building terminated because of errors.


I could see that my boost libs has not “-s” string in its name, so i change the name of the thread, filesystem, chrono and system boost libraries, because they are libs which the compilation say that it need… and after that, the I receive the following link error:

scons: Reading SConscript files ...
scons version: 2.3.2
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if toolchain is in 64-bit mode... (cached) no
Checking if we are using libstdc++... (cached) no
WARNING: Cannot disable C++11 features when using MSVC
Checking if we are on a POSIX system... (cached) no
Checking for VS 2013 Update 2 or Later... (cached) no
Checking for __declspec(thread)... (cached) yes
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file boost/version.hpp... (cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether timegm is declared... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /DEBUG /INCREMENTAL:NO /OUT:build\win32\normal\arrayExample.exe /LIBPATH:build\win32\normal /LIBPATH:src /LIBPATH:C:\boost\lib ws2_32.lib DbgHelp.lib /PDB:build\win32\normal\arrayExample.pdb /DEBUG build\win32\normal\mongo\client\examples\arrayExample.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &,int)" (??0exception@std@@QAE@ABQBDH@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __gmtime64 already defined in LIBCMT.lib(gmtime64.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual char const * __thiscall std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strerror already defined in LIBCMT.lib(strerror.obj)
   Creating library build\win32\normal\arrayExample.lib and object build\win32\normal\arrayExample.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : error LNK1218: warning treated as error; no output file generated
scons: building terminated because of errors.


any idea guys ??? sorry if my question are noobs, but I’m not windows user !!!!!!!

best regards


Freddy Martinez Garcia
Lic. Ciencia de la Computacion
C++ and Qt Senior Developer
freddy...@gmail.com

Andrew Morrow

unread,
Jul 28, 2014, 8:36:25 AM7/28/14
to mongod...@googlegroups.com


Hi Freddy -

When posting a question about the driver, please state what version of the driver you are building, and provide detailed information on your OS, toolchain, build invocation, etc. Please see this page for details on what information we need when answeringquestions: https://github.com/mongodb/mongo-cxx-driver/wiki/Download%20and%20Compile#how-to-ask-for-help

Some comments below:

On Mon, Jul 28, 2014 at 12:55 AM, Freddy Martinez Garcia <freddy...@gmail.com> wrote:
Hi guys… I have spent some days trying to compiling mongo-clien-cxx driver for windows and after some efforts, my compilation doesn’t link well against boost.

I need to say that I’m not a windows user… I’ve installed Visual Studio 2010 and I had compiled the boost using this configuration…

Unless you have a particular reason to build boost from source, I recommend using the pre-built boost windows binaries.
 

boost files are generated like I show u in the image boost-lib-dir.png

I think you forgot to attach this.
 

well… the first output of the compilation is:

scons: Reading SConscript files ...
scons version: 2.3.2
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if toolchain is in 64-bit mode... (cached) no
Checking if we are using libstdc++... (cached) no
WARNING: Cannot disable C++11 features when using MSVC
Checking if we are on a POSIX system... (cached) no
Checking for VS 2013 Update 2 or Later... (cached) no
Checking for __declspec(thread)... (cached) yes
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file boost/version.hpp... (cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether timegm is declared... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /DEBUG /INCREMENTAL:NO /OUT:build\win32\normal\arrayExample.exe /LIBPATH:build\win32\normal /LIBPATH:src /LIBPATH:C:\boost\lib ws2_32.lib DbgHelp.lib /PDB:build\win32\normal\arrayExample.pdb /DEBUG build\win32\normal\mongo\client\examples\arrayExample.obj
LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-s-1_55.lib'
scons: building terminated because of errors.

Can you please list the contents of c:\boost\lib? You can filter the output to just include the system and thread libraries rather than posting a PNG. Also, this can't be the output of the first compilation, since the configure checks are all cached, and it skipped directly to linking. Can you start clean, by removing the 'build' directory (and the .scons directory, if one exists at the root of your source tree).
 


I could see that my boost libs has not “-s” string in its name, so i change the name of the thread, filesystem, chrono and system boost libraries, because they are libs which the compilation say that it need… and after that, the I receive the following link error:

You can't change the name of the boost libraries like that: those suffixes have meaning:

This is a consequence of renaming the libraries since you are now, I believe, mixing the static and dynamic libraries.
 


any idea guys ??? sorry if my question are noobs, but I’m not windows user !!!!!!!

It is hard to know without any additional information about your boost installation, but I suspect that you don't have the boost library variants that link to the static MSVC runtime. Can you try building the driver with --dynamic-windows?

If that fixes it, then your options are to either stick with the dynamic MSVC runtime, or re-build boost to install the boost libraries that link the static runtime and rebuild the driver without --dynamic-windows.

Thanks,
Andrew


 

Freddy Martinez

unread,
Jul 28, 2014, 3:54:47 PM7/28/14
to mongod...@googlegroups.com
thanks for help me again Andrew...

well... I have a c:\boost folder where I have boot includes and libraries... I'm going to attach an image

I'm using windows xp, boost 1.55, this mongo-cxx-driver: https://github.com/mongodb/mongo-cxx-driver, compiler MVC2010, I had build the boost using the command line: bootstrap (the console detect automatically that I have the Visual Studio 2010 installed and it take this configuration), after that I excute b2 --prefix=c:\boost and the compilation finished OK.

After that, I had installed the last version of python2.7 and SCons.

the command line to compile the mongo which I used was: scons --libpath=c:\boost\libs --cpppath=c:\boost\include --prefix=c:\mongo-client

I could see that the mongo-client-s.lib file is generated, but no the structure of the .h files... the link error which I receive is trying ti compile some examples, and for that, the compilation and installation process don't finish...

I think that is all the information my friend. The error are in first message of this post.

regards my friend

Andrew Morrow

unread,
Jul 28, 2014, 4:03:53 PM7/28/14
to mongod...@googlegroups.com

Hi Freddy -

Based on the information you have provided on your boost installation, it appears that all of your boost libraries are built against the dynamic windows runtime. Therefore, you must build the C++ driver with the --dynamic-windows option. Please try re-building the driver and examples with that option. You should also probably clear out the c:\mongo-client directory before building, since the artifacts currently populated there are likely broken.

You should also know that if you are building the head of the legacy branch that this is not yet a released version of the driver, so it is not suitable for production use. It is at release candidate status, so we expect to be releasing a 1.0.0 in the next few weeks.

Also, please note that images aren't a great way to convey the information about the boost libraries, since I can't scroll your image or search for text in it:) In the future, attaching a text file of 'dir' output may be more effective.

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/2364a3a6-dbf2-421b-a1ff-a40d802a44b1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Freddy Martinez

unread,
Jul 29, 2014, 9:13:04 AM7/29/14
to mongod...@googlegroups.com
Hi Andrew... sorry for not answer yesterday, I had some troubles with my internet connection...

I did what you told me, I run: scons --libpath=c:\boost\lib --cpppath=c:\boost\include --dynamic-windows and I have the following error:

scons: Reading SConscript files ...
scons version: 2.3.2
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if toolchain is in 64-bit mode... (cached) no
Checking if we are using libstdc++... (cached) no
WARNING: Cannot disable C++11 features when using MSVC
Checking if we are on a POSIX system... (cached) no
Checking for VS 2013 Update 2 or Later... (cached) no
Checking for __declspec(thread)... (cached) yes
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file boost/version.hpp... (cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether timegm is declared... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /DEBUG /INCREMENTAL:NO /OUT:build\win32\dynamic-windows\arrayExample.exe /LIBPATH:build\win32\dynamic-windows /LIBPATH:src /LIBPATH:C:\boost\lib ws2_32.lib DbgHelp.lib /PDB:build\win32\dynamic-windows\arrayExample.pdb /DEBUG build\win32\dynamic-windows\mongo\client\examples\arrayExample.obj
LINK : fatal error LNK1104: cannot open file 'boost_date_time-vc100-mt-1_55.lib'
scons: building terminated because of errors.


after that, I have libboost_date_time-vc100-mt-1_55.lib file but not boost_date_time-vc100-mt-1_55.lib, so, I try to change the file name and the problem which I found was this

scons: Reading SConscript files ...
scons version: 2.3.2
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if toolchain is in 64-bit mode... (cached) no
Checking if we are using libstdc++... (cached) no
WARNING: Cannot disable C++11 features when using MSVC
Checking if we are on a POSIX system... (cached) no
Checking for VS 2013 Update 2 or Later... (cached) no
Checking for __declspec(thread)... (cached) yes
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file boost/version.hpp... (cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether timegm is declared... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /DEBUG /INCREMENTAL:NO /OUT:build\win32\dynamic-windows\arrayExample.exe /LIBPATH:build\win32\dynamic-windows /LIBPATH:src /LIBPATH:C:\boost\lib ws2_32.lib DbgHelp.lib /PDB:build\win32\dynamic-windows\arrayExample.pdb /DEBUG build\win32\dynamic-windows\mongo\client\examples\arrayExample.obj
   Creating library build\win32\dynamic-windows\arrayExample.lib and object build\win32\dynamic-windows\arrayExample.exp
libmongoclient.lib(background.obj) : warning LNK4049: locally defined symbol ?generic_category@system@boost@@YAABVerror_category@12@XZ (class boost::system::error_category const & __cdecl boost::system::generic_category(void)) imported
LINK : error LNK1218: warning treated as error; no output file generated
scons: building terminated because of errors.

any other advice my friend ?

best regard

Andrew Morrow

unread,
Jul 29, 2014, 9:51:40 AM7/29/14
to mongod...@googlegroups.com

Hi Freddy -

As I mentioned before, you can't just rename the boost library files: the names have very specific meanings. Perhaps you would have better luck if you just used the pre-built boost binaries available here: http://sourceforge.net/projects/boost/files/boost-binaries.

If you don't want to to do that, then since it appears that you have built boost without DLLs, you will need to either:

1) add --dynamic-boost=off to the mongo-client SCons invocation.
2) rebuild boost to include the -s (static CRT) variants and drop the --dynamic-windows flag from the mongo-client SCons invocation.

Thanks,
Andrew

Freddy Martinez

unread,
Jul 29, 2014, 4:11:00 PM7/29/14
to mongod...@googlegroups.com
Thank you very much my friend.... I had downloaded the boost binaries corresponding to the Visual Studio 2010 from the link which you give me and I could compile mongo-driver-cxx perfectly.

i will like to edit the subject of this thread as SOLVED to help other who can have the same problem but I can't find where 

thank you again my friend...

regards

Freddy Martinez

unread,
Jul 31, 2014, 1:09:04 AM7/31/14
to mongod...@googlegroups.com
Hi Andrew, sorry for answer again, but after compile the c++ client for windows i Can't use it...

Let me tell you all what I did...

  • I had installed Windows 7
  • I had download the boost and compile it my self.
  • after that, i download the c++ client driver from 26compat branch as the doc recommend
  • I compile the driver and the result was success, generating a libmongoclient.lib file
  • I went to Visual Studio 2012 (which is the version of MSVC that I have now) and my code is this

#include <WinSock2.h>

#include <Windows.h>

#include "stdafx.h"

#include <mongo\client\dbclient.h>



int _tmain(int argc, _TCHAR* argv[])

{

return 0;

}

  • the received error was: 
    • Error 3 error C1004: unexpected end-of-file found c:\mongo\include\mongo\client\dbclient.h 46 1 ConsoleApplication2 
  • after that, I check this line in dbclient.h and I don't see the error...
any idea my friend ??
I couldn't make the deploy on windows yet my friend

best regards

Andrew Morrow

unread,
Jul 31, 2014, 9:46:48 AM7/31/14
to mongod...@googlegroups.com

Hi Freddy -

You haven't said what version of the driver, but on the 'legacy' branch line 46 of dbclient.h is an #error directive. There is a bug in MSVC where in some situations the compiler issues an incorrect diagnostic when encountering an #error, rather than emitting the #error text:


So the "unexpected end-of-file found" message is a bit misleading. The real problem seems to be that this check in dbclient.h is failing:

#if defined(_WIN32) && !defined(_WINSOCK2API_)
#error "You must include the windows and windows sockets headers before dbclient.h"
#endif

What is odd about that is that it appears that you have correctly included windows.h and winsock2.h before including dbclient.h in your application, so I would expect that check to pass.

Does your winsock2.h header define _WINSOCK2API_?

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.

Freddy Martinez

unread,
Jul 31, 2014, 10:02:21 AM7/31/14
to mongod...@googlegroups.com
Hi Andrew...

yes, my windsock2.h define _WINSOCK2API_ because the first lines that it has are:

#ifndef _WINSOCK2API_

#define _WINSOCK2API_

#define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */


And my problem is exactly what you told... "unexpected end-of-file found" in this line... 

regards my friend

Andrew Morrow

unread,
Jul 31, 2014, 10:13:20 AM7/31/14
to mongod...@googlegroups.com

Can you try removing dbclient.h from your application, and replace it (at exactly the same place in the file) with the following snippet of code:

#if defined(_WIN32) && !defined(_WINSOCK2API_)
#error "dbclient.h check would fail"
#endif




Freddy Martinez

unread,
Jul 31, 2014, 10:17:20 AM7/31/14
to mongod...@googlegroups.com
I did it, and the error message now is: "dbclient.h check would fail" like you put in the #error directive

Andrew Morrow

unread,
Jul 31, 2014, 10:25:37 AM7/31/14
to mongod...@googlegroups.com

Can you remove or comment out the stdafx.h header and recompile? If winsock2.h defines _WINSOCK2API_, but it is then not defined in your application, then either the header isn't really being included, or something else must be undefining _WINSOCK2API_.

Is this the first compilation error you get?


Andrew Morrow

unread,
Jul 31, 2014, 10:32:59 AM7/31/14
to mongod...@googlegroups.com

Hi Freddy -

When using stdafx.h, you must include it first in your source file, before anything else: http://www.viva64.com/en/b/0265/#ID0EFGDK

Can you try moving stdafx.h to be the first include followed by the windows.h and winsock2.h headers, then dbclient.h??


Freddy Martinez

unread,
Jul 31, 2014, 10:37:48 AM7/31/14
to mongod...@googlegroups.com
well... Visual Studio don't let me remove the stdafx.h file.... so I had change the include order by

#include <WinSock2.h>

#include <Windows.h>

#include <mongo\client\dbclient.h>

#include "stdafx.h"


After that, the error is the following... I had put the warnings too my friend and I have the mongo include dir in my project..

Warning 1 warning C4627: '#include <WinSock2.h>': skipped when looking for precompiled header use \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 4 1 ConsoleApplication2
Warning 2 warning C4627: '#include <Windows.h>': skipped when looking for precompiled header use \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 5 1 ConsoleApplication2
Warning 3 warning C4627: '#include <mongo\client\dbclient.h>': skipped when looking for precompiled header use \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 6 1 ConsoleApplication2
Error 4 error C2653: 'mongo' : is not a class or namespace name \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 11 1 ConsoleApplication2
Error 5 error C2065: 'BSONObj' : undeclared identifier \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 11 1 ConsoleApplication2
Error 6 error C2146: syntax error : missing ';' before identifier 'vamosCarajo' \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 11 1 ConsoleApplication2
Error 7 error C2065: 'vamosCarajo' : undeclared identifier \\psf\home\documents\visual studio 2012\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp 11 1 ConsoleApplication2

Freddy Martinez

unread,
Jul 31, 2014, 10:39:48 AM7/31/14
to mongod...@googlegroups.com
if I put the  stdafx.h as first i got that:

Error 1 error C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\mongo\include\mongo\util\goodies.h 154 1 ConsoleApplication2

Andrew Morrow

unread,
Jul 31, 2014, 11:16:20 AM7/31/14
to mongod...@googlegroups.com

You will need to define the relevant CRT macros in your project to suppress these warnings.


Andrew Morrow

unread,
Jul 31, 2014, 12:04:45 PM7/31/14
to mongod...@googlegroups.com

Freddy -

I've filed https://jira.mongodb.org/browse/CXX-294 to improve this so that users are not required to define the _CRT and _SLC secure macros when consuming our headers. A fix should be headed to the legacy branch soon.

Thanks,
Andrew

Freddy Martinez

unread,
Aug 1, 2014, 8:45:34 AM8/1/14
to mongod...@googlegroups.com
Hi Andrew

Yesterday I wrote you telling you that now I have this error in the Visual Studio, I don't know if you have received this message

regards my friend...

Warning 1 warning C4003: not enough actual parameters for macro 'max' c:\mongolib\include\mongo\base\string_data.h 93 1 mongo
Error 2 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\base\string_data.h 93 1 mongo
Error 3 error C2059: syntax error : '::' c:\mongolib\include\mongo\base\string_data.h 93 1 mongo
Error 4 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\base\string_data-inl.h 29 1 mongo
Error 5 error C2059: syntax error : '::' c:\mongolib\include\mongo\base\string_data-inl.h 29 1 mongo
Error 6 error C2660: 'mongo::StringData::substr' : function does not take 1 arguments c:\mongolib\include\mongo\base\string_data-inl.h 127 1 mongo
Warning 7 warning C4251: 'mongo::ExceptionInfo::msg' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::ExceptionInfo' c:\mongolib\include\mongo\util\assert_util.h 71 1 mongo
Warning 8 warning C4251: 'mongo::DBException::_shard' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBException' c:\mongolib\include\mongo\util\assert_util.h 121 1 mongo
Warning 9 warning C4251: 'mongo::logger::LogstreamBuilder::_contextName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder' c:\mongolib\include\mongo\logger\logstream_builder.h 131 1 mongo
Warning 10 warning C4251: 'mongo::logger::LogstreamBuilder::_severity' : class 'mongo::logger::LogSeverity' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder' c:\mongolib\include\mongo\logger\logstream_builder.h 132 1 mongo
Warning 11 warning C4251: 'mongo::logger::LogstreamBuilder::_baseMessage' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder' c:\mongolib\include\mongo\logger\logstream_builder.h 133 1 mongo
Warning 12 warning C4003: not enough actual parameters for macro 'max' c:\mongolib\include\mongo\bson\optime.h 96 1 mongo
Error 13 error C2059: syntax error : '(' c:\mongolib\include\mongo\bson\optime.h 96 1 mongo
Error 14 error C2143: syntax error : missing ',' before '?' c:\mongolib\include\mongo\bson\optime.h 96 1 mongo
Error 15 error C2535: 'mongo::OpTime::OpTime(void)' : member function already defined or declared c:\mongolib\include\mongo\bson\optime.h 96 1 mongo
Warning 16 warning C4003: not enough actual parameters for macro 'max' c:\mongolib\include\mongo\bson\bsonelement.h 606 1 mongo
Error 17 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\bson\bsonelement.h 606 1 mongo
Error 18 error C2059: syntax error : '::' c:\mongolib\include\mongo\bson\bsonelement.h 606 1 mongo
Error 19 error C2143: syntax error : missing ';' before '{' c:\mongolib\include\mongo\bson\bsonelement.h 606 1 mongo
Warning 20 warning C4003: not enough actual parameters for macro 'max' c:\mongolib\include\mongo\bson\bsonelement.h 607 1 mongo
Error 21 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\bson\bsonelement.h 607 1 mongo
Error 22 error C2059: syntax error : '::' c:\mongolib\include\mongo\bson\bsonelement.h 607 1 mongo
Warning 23 warning C4003: not enough actual parameters for macro 'min' c:\mongolib\include\mongo\bson\bsonelement.h 609 1 mongo
Error 24 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\bson\bsonelement.h 609 1 mongo
Error 25 error C2059: syntax error : '::' c:\mongolib\include\mongo\bson\bsonelement.h 609 1 mongo
Error 26 error C2143: syntax error : missing ';' before '{' c:\mongolib\include\mongo\bson\bsonelement.h 609 1 mongo
Warning 27 warning C4003: not enough actual parameters for macro 'min' c:\mongolib\include\mongo\bson\bsonelement.h 610 1 mongo
Error 28 error C2589: '(' : illegal token on right side of '::' c:\mongolib\include\mongo\bson\bsonelement.h 610 1 mongo
Error 29 error C2059: syntax error : '::' c:\mongolib\include\mongo\bson\bsonelement.h 610 1 mongo
Warning 30 warning C4251: 'mongo::BSONObj::_holder' : class 'boost::intrusive_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::BSONObj' c:\mongolib\include\mongo\bson\bsonobj.h 557 1 mongo
Warning 31 warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::BSONObjBuilderValueStream' c:\mongolib\include\mongo\bson\bsonmisc.h 201 1 mongo
Warning 32 warning C4251: 'mongo::BSONObjBuilderValueStream::_fieldName' : class 'mongo::StringData' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilderValueStream' c:\mongolib\include\mongo\bson\bsonmisc.h 233 1 mongo
Warning 33 warning C4251: 'mongo::BSONObjBuilderValueStream::_subobj' : class 'std::auto_ptr<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilderValueStream' c:\mongolib\include\mongo\bson\bsonmisc.h 238 1 mongo
Warning 34 warning C4275: non dll-interface class 'mongo::BSONBuilderBase' used as base for dll-interface class 'mongo::BSONObjBuilder' c:\mongolib\include\mongo\bson\bsonobjbuilder.h 52 1 mongo
Warning 35 warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::BSONObjBuilder' c:\mongolib\include\mongo\bson\bsonobjbuilder.h 52 1 mongo
Warning 36 warning C4251: 'mongo::BSONObjBuilder::_buf' : class 'mongo::_BufBuilder<Allocator>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilder' c:\mongolib\include\mongo\bson\bsonobjbuilder.h 695 1 mongo
Warning 37 warning C4251: 'mongo::BSONObjBuilder::numStrs' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilder' c:\mongolib\include\mongo\bson\bsonobjbuilder.h 701 1 mongo
Error 38 error C1903: unable to recover from previous error(s); stopping compilation \\psf\home\documents\visual studio 2012\Projects\mongo\mongo\c1xx mongo
39 IntelliSense: expected an identifier c:\mongolib\include\mongo\base\string_data.h 93 80 mongo

Tyler Brock

unread,
Aug 1, 2014, 10:23:01 AM8/1/14
to mongod...@googlegroups.com
Hi Freddy,

How are you accessing the mongo-cxx-driver code? I ask because this may be related to problems with line endings.

-Tyler


Freddy Martinez

unread,
Aug 1, 2014, 10:27:28 AM8/1/14
to mongod...@googlegroups.com
Hi Tyler and thanks for answer...

no my friend, I'm not accessing to the mongo-cxx-driver code. I just download it and I'm trying to compile it for Windows... my problem is that I'm not a windows user and I have not experience making a deploy for windows, but I'm not modifying the code of the mongo-cxx-driver.

regards

Freddy Martinez

unread,
Aug 1, 2014, 10:34:42 AM8/1/14
to mongod...@googlegroups.com
Guys... can you help me with an URL for a mongo repo to be used for production deploy ???

maybe I'm using someone who is not the indicated. I can download this one and after that I will tell u if everything is OK or not.

regards

Tyler Brock

unread,
Aug 1, 2014, 10:57:50 AM8/1/14
to mongod...@googlegroups.com
This is the branch you are looking for:



--
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.

Freddy Martinez

unread,
Aug 2, 2014, 4:12:54 PM8/2/14
to mongod...@googlegroups.com
Hi Tyler... he problems don't despair my friend

I had download the driver from the address what you give me. I had made a checkout over 26compat branch and after that I had compiled the mongo-cxx-driver. Until here i was happy :), because everything was fine...

well, I had the followinf main() function in my cpp file:

#include <mongo/bson/bson.h>
#include <mongo/client/dbclient.h>

int main(int argc, char *argv[])
{
    mongo::Query yy;
}

compiling this code QtCreator and Visual Studio give me the following output:

17:07:54: Running steps for project untitled5...

17:07:54: Configuration unchanged, skipping qmake step.

17:07:54: Starting: "C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe"

C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe -f Makefile.Debug

cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\untitled5.pdb -DUNICODE -DWIN32 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtWidgets" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtGui" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtCore" -I"debug" -I"." -I"." -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\mkspecs\win32-msvc2012" -Fodebug\ @C:\Users\freddy\AppData\Local\Temp\main.obj.2400.16.jom

main.cpp

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/assert_util.h(105) : warning C4100: 'ss' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/goodies.h(153) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

C:\Program Files\Microsoft Visual Studio 11.0\VC\INCLUDE\string.h(191) : see declaration of 'strncpy'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(70) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(76) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(82) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(89) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(95) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(546) : warning C4100: 'm' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(548) : warning C4100: 'nReturned' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(548) : warning C4100: 'data' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(133) : warning C4100: 'conn' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(134) : warning C4100: 'conn' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(135) : warning C4100: 'conn' : unreferenced formal parameter

..\untitled5\main.cpp(7) : warning C4100: 'argv' : unreferenced formal parameter

..\untitled5\main.cpp(7) : warning C4100: 'argc' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(301) : warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

C:\Program Files\Microsoft Visual Studio 11.0\VC\INCLUDE\stdio.h(349) : see declaration of '_snprintf'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(297) : while compiling class template member function 'void mongo::StringBuilderImpl<Allocator>::appendDoubleNice(double)'

with

[

Allocator=mongo::TrivialAllocator

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson-inl.h(674) : see reference to function template instantiation 'void mongo::StringBuilderImpl<Allocator>::appendDoubleNice(double)' being compiled

with

[

Allocator=mongo::TrivialAllocator

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/hex.h(47) : see reference to class template instantiation 'mongo::StringBuilderImpl<Allocator>' being compiled

with

[

Allocator=mongo::TrivialAllocator

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(336) : warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

C:\Program Files\Microsoft Visual Studio 11.0\VC\INCLUDE\stdio.h(349) : see declaration of '_snprintf'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(272) : see reference to function template instantiation 'mongo::StringBuilderImpl<Allocator> &mongo::StringBuilderImpl<Allocator>::SBNUM<int>(T,int,const char *)' being compiled

with

[

Allocator=mongo::TrivialAllocator,

T=int

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(272) : see reference to function template instantiation 'mongo::StringBuilderImpl<Allocator> &mongo::StringBuilderImpl<Allocator>::SBNUM<int>(T,int,const char *)' being compiled

with

[

Allocator=mongo::TrivialAllocator,

T=int

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/builder.h(271) : while compiling class template member function 'mongo::StringBuilderImpl<Allocator> &mongo::StringBuilderImpl<Allocator>::operator <<(int)'

with

[

Allocator=mongo::TrivialAllocator

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonelement.h(490) : see reference to function template instantiation 'mongo::StringBuilderImpl<Allocator> &mongo::StringBuilderImpl<Allocator>::operator <<(int)' being compiled

with

[

Allocator=mongo::TrivialAllocator

]

echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\untitled5.exe.embed.manifest">debug\untitled5.exe_manifest.rc

if not exist debug\untitled5.exe if exist debug\untitled5.exe.embed.manifest del debug\untitled5.exe.embed.manifest

if exist debug\untitled5.exe.embed.manifest copy /Y debug\untitled5.exe.embed.manifest debug\untitled5.exe_manifest.bak

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\untitled5.exe.embed.manifest /OUT:debug\untitled5.exe @C:\Users\freddy\AppData\Local\Temp\untitled5.exe.2400.5054.jom

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mongo::Query::Query(void)" (__imp_??0Query@mongo@@QAE@XZ) referenced in function _main

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mongo::Query::~Query(void)" (__imp_??1Query@mongo@@QAE@XZ) referenced in function _main

debug\untitled5.exe : fatal error LNK1120: 2 unresolved externals

jom: C:\qt-projects\build-untitled5-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile.Debug [debug\untitled5.exe] Error 1120

jom: C:\qt-projects\build-untitled5-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile [debug] Error 2

17:07:59: The process "C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe" exited with code 2.

Error while building/deploying project untitled5 (kit: Desktop Qt 5.3 MSVC2012 OpenGL 32bit)

When executing step 'Make'

17:07:59: Elapsed time: 00:05.


I can't link against the libmongoclient.lib generated by the compilation and I don't know why. I give you the output to show you that there is a lot of warnings.


another question for you is: how can I generate a libmongoclient.dll file and not a libmongoclient.lib file ? 


regards and thank you

Freddy Martinez

unread,
Aug 2, 2014, 4:36:01 PM8/2/14
to mongod...@googlegroups.com
another thing to show is...

first, when I start to compile the driver, it ask me to include windows.h and winsock2.h. Well if I include this files I had the following output

#include <WinSock2.h>
#include <Windows.h>
#include <mongo/client/dbclient.h>

int main(int argc, char *argv[])
{
    mongo::BSONObj obj;
}

error:

17:33:13: Running steps for project untitled...

17:33:13: Configuration unchanged, skipping qmake step.

17:33:13: Starting: "C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe"

C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe -f Makefile.Debug

cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\untitled.pdb -DUNICODE -DWIN32 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtWidgets" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtGui" -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\include\QtCore" -I"debug" -I"." -I"." -I"..\..\Qt\Qt5.3.1\5.3\msvc2012_opengl\mkspecs\win32-msvc2012" -Fodebug\ @C:\Users\freddy\AppData\Local\Temp\main.obj.1660.16.jom

main.cpp

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/assert_util.h(71) : warning C4251: 'mongo::ExceptionInfo::msg' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::ExceptionInfo'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/assert_util.h(121) : warning C4251: 'mongo::DBException::_shard' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBException'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/assert_util.h(105) : warning C4100: 'ss' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/goodies.h(153) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

C:\Program Files\Microsoft Visual Studio 11.0\VC\INCLUDE\string.h(191) : see declaration of 'strncpy'

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/logstream_builder.h(131) : warning C4251: 'mongo::logger::LogstreamBuilder::_contextName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/logstream_builder.h(132) : warning C4251: 'mongo::logger::LogstreamBuilder::_severity' : class 'mongo::logger::LogSeverity' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder'

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/log_severity.h(32) : see declaration of 'mongo::logger::LogSeverity'

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/logstream_builder.h(133) : warning C4251: 'mongo::logger::LogstreamBuilder::_baseMessage' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::logger::LogstreamBuilder'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobj.h(557) : warning C4251: 'mongo::BSONObj::_holder' : class 'boost::intrusive_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::BSONObj'

with

[

T=mongo::BSONObj::Holder

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonmisc.h(201) : warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::BSONObjBuilderValueStream'

C:\Program Files\Windows Kits\8.0\include\um\boost/noncopyable.hpp(24) : see declaration of 'boost::noncopyable_::noncopyable'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonmisc.h(201) : see declaration of 'mongo::BSONObjBuilderValueStream'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonmisc.h(233) : warning C4251: 'mongo::BSONObjBuilderValueStream::_fieldName' : class 'mongo::StringData' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilderValueStream'

C:\Program Files\Windows Kits\8.0\include\um\mongo/base/string_data.h(43) : see declaration of 'mongo::StringData'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonmisc.h(238) : warning C4251: 'mongo::BSONObjBuilderValueStream::_subobj' : class 'std::auto_ptr<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilderValueStream'

with

[

_Ty=mongo::BSONObjBuilder

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(52) : warning C4275: non dll-interface class 'mongo::BSONBuilderBase' used as base for dll-interface class 'mongo::BSONObjBuilder'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_builder_base.h(29) : see declaration of 'mongo::BSONBuilderBase'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(52) : see declaration of 'mongo::BSONObjBuilder'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(52) : warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::BSONObjBuilder'

C:\Program Files\Windows Kits\8.0\include\um\boost/noncopyable.hpp(24) : see declaration of 'boost::noncopyable_::noncopyable'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(52) : see declaration of 'mongo::BSONObjBuilder'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(695) : warning C4251: 'mongo::BSONObjBuilder::_buf' : class 'mongo::_BufBuilder<Allocator>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilder'

with

[

Allocator=mongo::TrivialAllocator

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobjbuilder.h(701) : warning C4251: 'mongo::BSONObjBuilder::numStrs' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::BSONObjBuilder'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(70) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(76) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(82) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(89) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bson_db.h(95) : warning C4100: 'id' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/sock.h(286) : warning C4251: 'mongo::Socket::_local' : struct 'mongo::SockAddr' needs to have dll-interface to be used by clients of class 'mongo::Socket'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/sock.h(93) : see declaration of 'mongo::SockAddr'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/sock.h(287) : warning C4251: 'mongo::Socket::_remote' : struct 'mongo::SockAddr' needs to have dll-interface to be used by clients of class 'mongo::Socket'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/sock.h(93) : see declaration of 'mongo::SockAddr'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/sock.h(298) : warning C4251: 'mongo::Socket::_logLevel' : class 'mongo::logger::LogSeverity' needs to have dll-interface to be used by clients of class 'mongo::Socket'

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/log_severity.h(32) : see declaration of 'mongo::logger::LogSeverity'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(322) : warning C4251: 'mongo::ConnectionString::_servers' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::ConnectionString'

with

[

_Ty=mongo::HostAndPort

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(323) : warning C4251: 'mongo::ConnectionString::_string' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::ConnectionString'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(324) : warning C4251: 'mongo::ConnectionString::_setName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::ConnectionString'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(326) : warning C4251: 'mongo::ConnectionString::_connectHookMutex' : class 'mongo::mutex' needs to have dll-interface to be used by clients of class 'mongo::ConnectionString'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/concurrency/mutex.h(74) : see declaration of 'mongo::mutex'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(352) : warning C4251: 'mongo::Query::ReadPrefField' : class 'mongo::BSONField<T>' needs to have dll-interface to be used by clients of class 'mongo::Query'

with

[

T=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(353) : warning C4251: 'mongo::Query::ReadPrefModeField' : class 'mongo::BSONField<T>' needs to have dll-interface to be used by clients of class 'mongo::Query'

with

[

T=std::string

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(354) : warning C4251: 'mongo::Query::ReadPrefTagsField' : class 'mongo::BSONField<T>' needs to have dll-interface to be used by clients of class 'mongo::Query'

with

[

T=mongo::BSONArray

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(474) : warning C4251: 'mongo::QuerySpec::_ns' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::QuerySpec'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(546) : warning C4100: 'm' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(548) : warning C4100: 'nReturned' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(548) : warning C4100: 'data' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(557) : warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::DBClientInterface'

C:\Program Files\Windows Kits\8.0\include\um\boost/noncopyable.hpp(24) : see declaration of 'boost::noncopyable_::noncopyable'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(557) : see declaration of 'mongo::DBClientInterface'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(601) : warning C4251: 'mongo::DBClientWithCommands::_seenIndexes' : class 'std::set<_Kty>' needs to have dll-interface to be used by clients of class 'mongo::DBClientWithCommands'

with

[

_Kty=std::string

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(604) : warning C4251: 'mongo::DBClientWithCommands::_logLevel' : class 'mongo::logger::LogSeverity' needs to have dll-interface to be used by clients of class 'mongo::DBClientWithCommands'

C:\Program Files\Windows Kits\8.0\include\um\mongo/logger/log_severity.h(32) : see declaration of 'mongo::logger::LogSeverity'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(835) : warning C4251: 'mongo::DBClientWithCommands::MRInline' : struct 'mongo::DBClientWithCommands::MROutput' needs to have dll-interface to be used by clients of class 'mongo::DBClientWithCommands'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(828) : see declaration of 'mongo::DBClientWithCommands::MROutput'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1046) : warning C4251: 'mongo::DBClientWithCommands::_runCommandHook' : class 'boost::function<Signature>' needs to have dll-interface to be used by clients of class 'mongo::DBClientWithCommands'

with

[

Signature=void (mongo::BSONObjBuilder *)

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1047) : warning C4251: 'mongo::DBClientWithCommands::_postRunCommandHook' : class 'boost::function<Signature>' needs to have dll-interface to be used by clients of class 'mongo::DBClientWithCommands'

with

[

Signature=void (const mongo::BSONObj &,const std::string &)

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1060) : warning C4251: 'mongo::DBClientBase::ConnectionIdSequence' : class 'mongo::AtomicWord<_WordType>' needs to have dll-interface to be used by clients of class 'mongo::DBClientBase'

with

[

_WordType=__int64

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1340) : warning C4251: 'mongo::DBClientConnection::p' : class 'boost::scoped_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

with

[

T=mongo::MessagingPort

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1341) : warning C4251: 'mongo::DBClientConnection::server' : class 'boost::scoped_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

with

[

T=mongo::SockAddr

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1344) : warning C4251: 'mongo::DBClientConnection::autoReconnectBackoff' : class 'mongo::Backoff' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/time_support.h(104) : see declaration of 'mongo::Backoff'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1345) : warning C4251: 'mongo::DBClientConnection::_server' : struct 'mongo::HostAndPort' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/hostandport.h(31) : see declaration of 'mongo::HostAndPort'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1346) : warning C4251: 'mongo::DBClientConnection::_serverString' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1347) : warning C4251: 'mongo::DBClientConnection::_serverAddrString' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1353) : warning C4251: 'mongo::DBClientConnection::authCache' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

with

[

_Kty=std::string,

_Ty=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientinterface.h(1357) : warning C4251: 'mongo::DBClientConnection::_numConnections' : struct 'mongo::AtomicUInt' needs to have dll-interface to be used by clients of class 'mongo::DBClientConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/atomic_int.h(35) : see declaration of 'mongo::AtomicUInt'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(37) : warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::DBClientCursorInterface'

C:\Program Files\Windows Kits\8.0\include\um\boost/noncopyable.hpp(24) : see declaration of 'boost::noncopyable_::noncopyable'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(37) : see declaration of 'mongo::DBClientCursorInterface'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(222) : warning C4251: 'mongo::DBClientCursor::batch' : class 'mongo::DBClientCursor::Batch' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(205) : see declaration of 'mongo::DBClientCursor::Batch'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(224) : warning C4251: 'mongo::DBClientCursor::_originalHost' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(225) : warning C4251: 'mongo::DBClientCursor::ns' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(233) : warning C4251: 'mongo::DBClientCursor::_putBack' : class 'std::stack<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

with

[

_Ty=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(237) : warning C4251: 'mongo::DBClientCursor::_scopedHost' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclientcursor.h(238) : warning C4251: 'mongo::DBClientCursor::_lazyHost' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientCursor'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(119) : warning C4251: 'mongo::PoolForHost::_hostName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::PoolForHost'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(120) : warning C4251: 'mongo::PoolForHost::_pool' : class 'std::stack<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::PoolForHost'

with

[

_Ty=mongo::PoolForHost::StoredConnection

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(133) : warning C4100: 'conn' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(134) : warning C4100: 'conn' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(135) : warning C4100: 'conn' : unreferenced formal parameter

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(153) : warning C4275: non dll-interface class 'mongo::PeriodicTask' used as base for dll-interface class 'mongo::DBConnectionPool'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/background.h(131) : see declaration of 'mongo::PeriodicTask'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(153) : see declaration of 'mongo::DBConnectionPool'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(239) : warning C4251: 'mongo::DBConnectionPool::_mutex' : class 'mongo::mutex' needs to have dll-interface to be used by clients of class 'mongo::DBConnectionPool'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/concurrency/mutex.h(74) : see declaration of 'mongo::mutex'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(240) : warning C4251: 'mongo::DBConnectionPool::_name' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBConnectionPool'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(247) : warning C4251: 'mongo::DBConnectionPool::_pools' : class 'std::map<_Kty,_Ty,_Pr>' needs to have dll-interface to be used by clients of class 'mongo::DBConnectionPool'

with

[

_Kty=mongo::DBConnectionPool::PoolKey,

_Ty=mongo::PoolForHost,

_Pr=mongo::DBConnectionPool::poolKeyCompare

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(257) : warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'mongo::AScopedConnection'

C:\Program Files\Windows Kits\8.0\include\um\boost/noncopyable.hpp(24) : see declaration of 'boost::noncopyable_::noncopyable'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(257) : see declaration of 'mongo::AScopedConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(277) : warning C4251: 'mongo::AScopedConnection::_numConnections' : struct 'mongo::AtomicUInt' needs to have dll-interface to be used by clients of class 'mongo::AScopedConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/util/atomic_int.h(35) : see declaration of 'mongo::AtomicUInt'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/connpool.h(361) : warning C4251: 'mongo::ScopedDbConnection::_host' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::ScopedDbConnection'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(215) : warning C4251: 'mongo::DBClientReplicaSet::_setName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(217) : warning C4251: 'mongo::DBClientReplicaSet::_masterHost' : struct 'mongo::HostAndPort' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/hostandport.h(31) : see declaration of 'mongo::HostAndPort'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(224) : warning C4251: 'mongo::DBClientReplicaSet::_master' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

with

[

T=mongo::DBClientConnection

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(227) : warning C4251: 'mongo::DBClientReplicaSet::_lastSlaveOkHost' : struct 'mongo::HostAndPort' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/hostandport.h(31) : see declaration of 'mongo::HostAndPort'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(229) : warning C4251: 'mongo::DBClientReplicaSet::_lastSlaveOkConn' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

with

[

T=mongo::DBClientConnection

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(230) : warning C4251: 'mongo::DBClientReplicaSet::_lastReadPref' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

with

[

T=mongo::ReadPreferenceSetting

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(238) : warning C4251: 'mongo::DBClientReplicaSet::_auths' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

with

[

_Kty=std::string,

_Ty=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(254) : warning C4251: 'mongo::DBClientReplicaSet::_lazyState' : class 'mongo::DBClientReplicaSet::LazyState' needs to have dll-interface to be used by clients of class 'mongo::DBClientReplicaSet'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(245) : see declaration of 'mongo::DBClientReplicaSet::LazyState'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/dbclient_rs.h(287) : warning C4251: 'mongo::TagSet::_tags' : struct 'mongo::BSONArray' needs to have dll-interface to be used by clients of class 'mongo::TagSet'

C:\Program Files\Windows Kits\8.0\include\um\mongo/bson/bsonobj.h(587) : see declaration of 'mongo::BSONArray'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/gridfs.h(125) : warning C4251: 'mongo::GridFS::_dbName' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::GridFS'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/gridfs.h(126) : warning C4251: 'mongo::GridFS::_prefix' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::GridFS'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/gridfs.h(127) : warning C4251: 'mongo::GridFS::_filesNS' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::GridFS'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/gridfs.h(128) : warning C4251: 'mongo::GridFS::_chunksNS' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::GridFS'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(141) : warning C4251: 'mongo::SyncClusterConnection::_address' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(142) : warning C4251: 'mongo::SyncClusterConnection::_connAddresses' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

_Ty=std::string

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(143) : warning C4251: 'mongo::SyncClusterConnection::_conns' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

_Ty=mongo::DBClientConnection *

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(145) : warning C4251: 'mongo::SyncClusterConnection::_lastErrors' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

_Ty=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(148) : warning C4251: 'mongo::SyncClusterConnection::_customQueryHandler' : class 'boost::scoped_ptr<T>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

T=mongo::SyncClusterConnection::QueryHandler

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(150) : warning C4251: 'mongo::SyncClusterConnection::_mutex' : class 'mongo::mutex' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/concurrency/mutex.h(74) : see declaration of 'mongo::mutex'

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(151) : warning C4251: 'mongo::SyncClusterConnection::_lockTypes' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class 'mongo::SyncClusterConnection'

with

[

_Kty=std::string,

_Ty=int

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(205) : warning C4251: 'mongo::UpdateNotTheSame::_addrs' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::UpdateNotTheSame'

with

[

_Ty=std::string

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/client/syncclusterconnection.h(206) : warning C4251: 'mongo::UpdateNotTheSame::_lastErrors' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'mongo::UpdateNotTheSame'

with

[

_Ty=mongo::BSONObj

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(32) : warning C4251: 'mongo::SSLGlobalParams::sslMode' : class 'mongo::AtomicWord<_WordType>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_WordType=int

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(34) : warning C4251: 'mongo::SSLGlobalParams::sslPEMKeyFile' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(35) : warning C4251: 'mongo::SSLGlobalParams::sslPEMKeyPassword' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(36) : warning C4251: 'mongo::SSLGlobalParams::sslClusterFile' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(37) : warning C4251: 'mongo::SSLGlobalParams::sslClusterPassword' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(38) : warning C4251: 'mongo::SSLGlobalParams::sslCAFile' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

C:\Program Files\Windows Kits\8.0\include\um\mongo/util/net/ssl_options.h(39) : warning C4251: 'mongo::SSLGlobalParams::sslCRLFile' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of struct 'mongo::SSLGlobalParams'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Alloc=std::allocator<char>

]

..\untitled\main.cpp(4) : warning C4100: 'argv' : unreferenced formal parameter

..\untitled\main.cpp(4) : warning C4100: 'argc' : unreferenced formal parameter

echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\untitled.exe.embed.manifest">debug\untitled.exe_manifest.rc

if not exist debug\untitled.exe if exist debug\untitled.exe.embed.manifest del debug\untitled.exe.embed.manifest

if exist debug\untitled.exe.embed.manifest copy /Y debug\untitled.exe.embed.manifest debug\untitled.exe_manifest.bak

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\untitled.exe.embed.manifest /OUT:debug\untitled.exe @C:\Users\freddy\AppData\Local\Temp\untitled.exe.1660.4087.jom

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mongo::BSONObj::BSONObj(void)" (__imp_??0BSONObj@mongo@@QAE@XZ) referenced in function _main

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mongo::BSONObj::~BSONObj(void)" (__imp_??1BSONObj@mongo@@QAE@XZ) referenced in function _main

debug\untitled.exe : fatal error LNK1120: 2 unresolved externals

jom: C:\qt-projects\build-untitled-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile.Debug [debug\untitled.exe] Error 1120

jom: C:\qt-projects\build-untitled-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile [debug] Error 2

17:33:17: The process "C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe" exited with code 2.

Error while building/deploying project untitled (kit: Desktop Qt 5.3 MSVC2012 OpenGL 32bit)

When executing step 'Make'

17:33:17: Elapsed time: 00:04.


if i don't include this files, then the error is like my last message.... link error


regards

Andrew Morrow

unread,
Aug 3, 2014, 7:19:42 PM8/3/14
to mongod...@googlegroups.com

Hi Freddy -

It looks like there are a few issues raised in your above emails, but I think there are three particularly important things to mention:

- If you intend to consume a static library version of the mongo C++ client library, you must define the preprocessor symbol STATIC_LIBMONGOCLIENT in all consuming files. This is true for both the 26compat and legacy branches.

- The warnings you identified are related to the issue we previously discussed about the _CRT... macros. For the 26compat branch, you will likely need to define the appropriate preprocessor symbols in your application to suppress the warnings. We will be making a change to the legacy branch soon that obviates the need to define those symbols.

- To build a DLL version of the library, you can use the --sharedclient flag to SCons. There are some caveats to doing so, and support on the 26compat branch is primitive. You will probably have better luck sticking with the static library if you use 26compat. Support for DLL builds of the driver is much better on the legacy branch, however.

If you haven't already, I recommend that you carefully read the following page on the C++ driver wiki, as it contains several notes of interest when building and consuming the C++ driver on Windows:


Please let us know if you have additional questions and we will be happy to 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.

Andrew Morrow

unread,
Aug 5, 2014, 1:57:47 PM8/5/14
to mongod...@googlegroups.com


Hi Freddy -

On Sun, Aug 3, 2014 at 7:19 PM, Andrew Morrow <andrew...@mongodb.com> wrote:



- The warnings you identified are related to the issue we previously discussed about the _CRT... macros. For the 26compat branch, you will likely need to define the appropriate preprocessor symbols in your application to suppress the warnings. We will be making a change to the legacy branch soon that obviates the need to define those symbols.

 


Please let us know if you have additional questions and we will be happy to help.

I wanted to check back and see if you were up and running. If not, please let me know where you are stuck and we will try to help.

Thanks,
Andrew

Reply all
Reply to author
Forward
0 new messages