Compilation of Bosn Bson-cpp implemented by C + +

Source: Internet
Author: User

Compilation of Bosn Bson-cpp implemented by C + +

Flyfish 2015-7-24

Compilation Environment:
VC2010 64-bit
Need to configure the boost library



In bsonspec.org, there is a C + + implementation of Bosn Github.com/jbetnet/bson-cpp
A Standalone C + + BSON implementation forked from the MongoDB C + + driver, with the Non-bson code pruned away.

A standalone, C + + Bson implementation that drives forks from MongoDB C + +, removing code unrelated to Bson.
GitHub
Https://github.com/jbenet/bson-cpp


Error 1
TIME_UTC ": Not a member of" boost "
C + + 11 defines TIME_UTC as a macro that, in order to avoid collisions, boost TIME_UTC to Time_utc_




Error 2
"Sleep": not a member of "boost"
"Thread": "::" the symbol on the left must be of type
void Sleep (System_time const& abs_time);


Check the 1.58.0 version of the boost document for sleep parsing
[Warning] Warning
DEPRECATED since 3.0.0.


Use This_thread::sleep_for () or This_thread::sleep_until ().
Warning:
The function has been enabled using This_thread::sleep_for () or This_thread::sleep_until ()


Sleep_until ()
Effects:
Suspends the current thread until the time point specified by Abs_time have been reached.
Role:
Suspends the current thread until the specified abs_time time point arrives


Sleep_for ()
Effects:
Role:
Suspends the current thread until the duration specified by by Rel_time have elapsed.
Suspends the current thread until the specified duration rel_time


One is time point, one is duration duration


Use boost::this_thread::sleep_for here
The Boost::thread::sleep (XT);
Boost::this_thread::sleep_for (Boost::chrono::seconds (xt.sec));


Compile the successful source code





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Compilation of Bosn Bson-cpp implemented by C + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.