Download Boost

Compile Boost

  1. Install Boost installation package
  2. Use x86 Native Tools Command Prompt to conpile: boosttrap.bat
  3. Input command: b2 intall
- Dynamic library: bjam install stage --toolset=msvc-12.0 --stagedir="C:\boost_1_62_0\lib64-msvc-12.0" link=shared runtime-link=shared threading=multi debug release  
- Static library: bjam install stage --toolset=msvc-12.0 --stagedir="C:\boost_1_62_0\lib64-msvc-12.0" link=static runtime-link=static threading=multi debug release 

Example

// testBoost.h
#ifndef TESTTOOLS_TESTBOOST_H_
#define TESTTOOLS_TESTBOOST_H_

namespace TEST_BOOST {
	bool testBoost();
}

#endif // !TESTTOOLS_TESTBOOST_H_

// testBoost.cpp
#include "stdafx.h"
#include "testBoost.h"
#include "boost/thread.hpp"

bool TEST_BOOST::testBoost() {
	boost::function<void()> func([](){std::cout << "my thread!" << std::endl; });
	boost::thread thread(func);
	thread.join();
	std::cout << "my thread is over!" << std::endl;
	return true;
}

Reference