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