Boost installation supplement)

Source: Internet
Author: User

7. Configuration

Include Directory: C: \ boost_1_41_0

Library Directory: C: \ boost_rj41_0 \ stage \ Lib

Add it to the corresponding path of the IDE.

 

8. Use

Example:

# Include <boost \ thread. HPP>

In this case, the library file does not need to be included. The boost auto-Link Mechanism will automatically help us include the corresponding static Lib. That is to say, boost is linked in static mode by default, so our project property should also be set to multi-threaded (Debug ). If you want to use DLL Dynamic Link, you need to define the macro in advance:

# Define boost_all_dyn_link

Similarly, boost will include the corresponding lib by default. If you do not want to use the auto-Link Mechanism provided by boost, or do not feel at ease with its automatic link (in fact, you do not have to worry about it), you can define the macro in advance:

# Define boost_all_no_lib

Use the following link:

# Pragma comment (Lib, "boost_thread-vc90-mt-1_39.lib ")

Or

# Pragma comment (Lib, "boost_thread-vc90-mt.lib ")

The two lib libraries are actually the same. I really don't understand why each library needs to be copied during boost compilation. Is it because the latter does not need to be changed after the boost version is upgraded?Code? There is also a useful macro:

# Define boost_lib_diagnostic

It allows VC to output data in the output window during compilation.ProgramWhich boost libraries are linked and the link sequence.

For details about the auto-Link Mechanism of boost, refer to the Code in boost \ config \ auto_link.hpp, which is easy to understand and worth learning.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/cay22/archive/2009/11/25/4873468.aspx

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.