I figured it out:
- extract boost_1_61_0 for example to C: so new folder named "C:\boost_1_61_0"
- from a command prompt or visual studio 2015-> Visual studio tools-> developer command prompt for ms2015 (run it as administrator)
- cd C:\boost_1_61_0
- bootstrap.bat
So new files are created: b2.exe and bjam.exe in the root folder. Now we build the x64 version of boost library:
- b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64
new folder "Stage" is created in root folder, inside this folder there's a folder named x64 inside which there's a folder "lib" (.lib files). the process takes some minutes (about 20 minutes)
when it's done a message tells you that boost_1_61_0 skips some targets, don't mind it's nothing because it belongs to other OSs
now we build the x86 version:
b2 -j8 toolset=msvc-14.0 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/win32
- wait until it's done.
now we have the two versions x64 and win32 but the root folder is too much big about 5.3 gigabyte.
now we install these two libraries to "C:\Boost" and then clean by removing the folder "C:\boost_1_61_0":
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=C:\Boost\x64 install
- I add install and changes the name of folder from stage to "C:\Boost\X64"
when it's done a new folder "C:\Boost" is created it contains include folder and x64 folder which contains lib files.
now we install win32 version:
b2 -j8 toolset=msvc-14.0 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=C:\Boost\win32 install
- when it's done remove a folder named lib inside: C:\Boost\
- time to clean and free up memory:
- remove the hole folder: C:\Boost_1_61_0 because we don't need it again
** how to add boost to my project?:
open Msvc2015->create c++ console new project, when it's created go to Project->
"MyBoostProject's" properties->C/C++->General->Additional include directories->edit->new folder->C:\Boost\include->boost_1_61
add another folder with the path: C:\Boost\include->Boost_1_61_0->Boost
now the include files are ready.
** How to link?:
If my project is x86:
go to: linker->General->Additional Library Directories->edit->Add new folder->C:\Boost\win32\Lib
If my project is x64:
linker->Additional library directories->edit->add new folder->C:\Boost\x64\Lib
I wish this post would be useful for anyone who was not able to install it.