[CXX-831] Compile under Visual Studio 2015 Created: 24/Jan/16  Updated: 19/Feb/16  Resolved: 27/Jan/16

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: 3.0.0-rc0
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Weizehua Assignee: Mark Benvenuto
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10, Visual Studio 2015 Enterprise Update 1


Attachments: Text File mongoc_error.cpp     Text File mongoc_error.hpp    

 Description   

修改方法:
mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(44):将参数类型从::bson_error_t改为const ::bson_error_t &
mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(47):将参数类型从::bson_error_t改为const ::bson_error_t &
mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(52):将参数类型从::bson_error_t改为const ::bson_error_t &
mongo-cxx-driver-r3.0.0-rc0\src\mongocxx\exception\private\mongoc_error.cpp(41):将参数类型从::bson_error_t改为const ::bson_error_t &

-----------------------------------------------------------------------------------
重现流程:
我跟着教程将libbson和libmongoc编译好了,然后运行:
cmake -DLIBBSON_DIR=<...> -DLIBMONGOC_DIR=<...> -DBSONCXX_POLY_USE_MNMLSTC=OFF -DBSONCXX_POLY_USE_BOOST=ON -DBOOST_ROOT=C:\local\boost_1_60_0 ..
msbuild ALL_BUILD.vcxproj
然后,出现了3个错误:
8>D:\WzhPrivate\Desktop\MongoDriver\mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(44): error C2719: “error”: 要求 8 对齐的形参将不被对齐
8>D:\WzhPrivate\Desktop\MongoDriver\mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(49): error C2719: “error”: 要求 8 对齐的形参将不被对齐
8>D:\WzhPrivate\Desktop\MongoDriver\mongo-cxx-driver-r3.0.0-rc0\src\mongocxx/exception/private/mongoc_error.hpp(55): error C2719: “error”: 要求 8 对齐的形参将不被对齐
mongo-cxx-driver-r3.0.0-rc0\src\mongocxx\exception\private\mongoc_error.cpp(41): error C2719: “error”: 要求 8 对齐的形参将不被对齐

粗略检查代码之后觉得传递实参是没必要的,所以就将其改为引用传递了,这样就可以编译通过了。



 Comments   
Comment by Andrew Morrow (Inactive) [ 27/Jan/16 ]

I'm closing this ticket since I've not heard back from you with any additional information. Please feel free to re-open the ticket or comment further if we can provide any more assistance.

Comment by Andrew Morrow (Inactive) [ 25/Jan/16 ]

Can you try the HEAD of the master branch? We do build it on Windows with VS2015 Update 1 on appveyor: https://ci.appveyor.com/project/markbenvenuto/mongo-cxx-driver

Generated at Wed Feb 07 22:00:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.