[CXX-561] MONGO_INITIALIZER_GENERAL in src/mongo/bson/oid.cpp won't execute Created: 18/Mar/15 Updated: 06/Dec/16 Resolved: 18/Mar/15 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | legacy-1.0.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Peng Xie | Assignee: | Adam Midvidy |
| Resolution: | Done | Votes: | 0 |
| Labels: | crash, legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
MONGO_INITIALIZER_GENERAL in src/mongo/bson/oid.cpp fails to execute and makes
a null pointer. This leads failure to call:
Running the binary compiled from
ends to:
|
| Comments |
| Comment by Peng Xie [ 18/Mar/15 ] | |||||||
|
That works! https://github.com/mongodb/mongo-cxx-driver/wiki/Configuring-the-Legacy-Driver also depicts it. I should have read it more carefully. Thanks! | |||||||
| Comment by Adam Midvidy [ 18/Mar/15 ] | |||||||
|
Hi Yuchen, Sorry to hear you are having trouble with the legacy driver! You must initialize the driver to ensure that Mongo initializer blocks are executed. You can do this by calling mongo::client::initialize or stack allocating a mongo::client::GlobalInstance in the main() block of your program. The correct code is:
Best, |