[CXX-459] compile error caused by connpool.h Created: 05/Jan/15  Updated: 07/Jan/15  Resolved: 07/Jan/15

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: legacy-1.0.0-rc3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: tianchaohaohan Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

#include <mongo/client/connpool.h>

g++ main.cpp -o main -lmongoclient -lboost_system -lboost_thread -lboost_filesystem -lboost_program_options -lboost_regex -std=c+
+11 -g
In file included from /usr/include/mongo/bson/bsonelement.h:25:0,
from /usr/include/mongo/bson/bsonobj.h:28,
from /usr/include/mongo/client/bulk_operation_builder.h:20,
from /usr/include/mongo/client/dbclientinterface.h:29,
from /usr/include/mongo/client/connpool.h:22,
from main.cpp:2:
/usr/include/mongo/bson/bsontypes.h: In function ‘int mongo::canonicalizeBSONType(mongo::BSONType)’:
/usr/include/mongo/bson/bsontypes.h:148:21: error: ‘verify’ was not declared in this scope verify(0); ^In file included from /usr/include/mongo/bson/oid.h:23:0, from /usr/include/mongo/bson/bsonelement.h:26, from /usr/include/mongo/bson/bsonobj.h:28, from /usr/include/mongo/client/bulk_operation_builder.h:20, from /usr/include/mongo/client/dbclientinterface.h:29, from /usr/include/mongo/client/connpool.h:22, from main.cpp:2:/usr/include/mongo/bson/util/builder.h: In member function ‘void mongo::StringBuilderImpl<Allocator>::appendDoubleNice(double)’:/usr/include/mongo/bson/util/builder.h: In member function ‘void mongo::StringBuilderImpl<Allocator>::appendDoubleNice(double)’:/usr/include/mongo/bson/util/builder.h:335:28: error: there are no arguments to ‘verify’ that depend on a template parameter, so a declaration of ‘verifyst be available [-fpermissive] verify( z >= 0 ); ^ ^/usr/include/mongo/bson/util/builder.h:335:28: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is depcated)recated)/usr/include/mongo/bson/util/builder.h:336:33: error: there are no arguments to ‘verify’ that depend on a template parameter, so a declaration of ‘verifyst be available [-fpermissive] verify( z < maxSize );



 Comments   
Comment by Andrew Morrow (Inactive) [ 07/Jan/15 ]

Hi -

I'm closing this because it sounds from the other ticket like you are have been able to build the driver.

Please feel free to re-open the ticket if you are still having problems.

Thanks,
Andrew

Comment by Andrew Morrow (Inactive) [ 06/Jan/15 ]

Hi -

You mentioned in CXX-458 that you had completed the build of the driver. Is this ticket now obsolete?

Thanks,
Andrew

Comment by Andrew Morrow (Inactive) [ 05/Jan/15 ]

Hi -

Unfortunately, the header files of the driver are not factored so as to be independently includable. Please include "mongo/client/dbclient.h" instead, which pulls in all of the headers necessary to use the library, in the appropriate order and with the appropriate macros defined.

Also, I'm puzzled how you are even managing to include connpool.h if you are using -rc3, since that file was not shipped as part of that release (the connection pool support was removed in the legacy-1.0.0-rc1 release (see CXX-336).

Can you please provide the information from here https://github.com/mongodb/mongo-cxx-driver/wiki/Download%20and%20Compile#how-to-ask-for-help about how you built the driver?

Thanks,
Andrew

Generated at Wed Feb 07 21:59:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.