1, first to the Boost website to download the latest version of the Boost library:
http://www.boost.org/
2. Unzip the file, open it to the root of the boost library at the command prompt, and execute the following command:
Bjam--toolset=msvc--build-type=complete Stage
Waiting for the program to compile, about two hours, will be generated in the boost root directory Bin.v2 and stage two folders, where Bin.v2 is generated intermediate files, the size of about 2.7G, can be directly deleted. The DLL and LIB files are generated under stage.
3. Open vs:
View, property Manager, current project->debug| Win32->microsoft.cpp.win32.user Double-click
In the Properties dialog box that pops up:
Common Properties->vc++ directory: "Include directory": Boost root directory, example: D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0
Library Directory: link library directory under stage, example: D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0\stage\lib
Generic properties, Linker, General: "Additional library directory": Same as above "library directory", example: D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0\stage\lib
At this point the environment is configured, the following test:
#include <cstdlib> #include <iostream> #include <vector> #include <iterator> #include < algorithm> #include <boost/timer.hpp> #include <boost/progress.hpp> #include <libs/date_time/src/ gregorian/greg_names.hpp> #include <libs/date_time/src/gregorian/date_generators.cpp> #include <libs/ Date_time/src/gregorian/greg_month.cpp> #include <libs/date_time/src/gregorian/gregorian_types.cpp>int Main () {Boost::timer t;boost::p rogress_display PD (+), for (int i = 0; i <; ++i) {++pd;} Boost::gregorian::d ate dt (8), Std::cout <<std::endl<< "The Day Is" <<dt.day_of_year () < < "Day of the Year" << std::endl<<std::endl;std::vector<int> TEST_VC (std::vector<int); >::iterator beg_it = Test_vc.begin (); Std::vector<int>::iterator end_it = Test_vc.end (); Std::srand (std::time (NULL)); for (; Beg_it! = End_it; ++beg_it) {*beg_it = rand ();} Beg_it = Test_vc.begin (); Std::copy (Beg_it, END_IT, std::Ostream_iterator<int> (Std::cout, "")); Std::cout << Std::endl << std::endl;std::sort (beg_it, End_it , std::greater<int> ()); Std::copy (Beg_it, End_it, std::ostream_iterator<int> (Std::cout, "")); std::cout << std::endl<<std::endl;std::cout << t.elapsed () << "s" << std::endl;system ("pause"); return 0;}
The program runs correctly:
Author: http://blog.csdn.net/lp310018931
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Basic ways to use the Boost library under Windows