Original article: boost installation and usage record
Other references: how to install and use boost in windows?
Http://www.cnblogs.com/finallyliuyu/archive/2010/08/23/1806811.html
Http://www.boostpro.com/download/
Install
Ubuntu:
1) Search for Boost installation in synaptic.
2) if you need to use the boost lib file during compilation, use-L to specify it.
Windows:
1) download the ICU beforehand. Assume that the decompressed path is c: \ ICU.
2) download the installation package on the boost homepage and decompress it. Assume that the decompressed path is c: \ boost \.
3) compile or download bjam.
4) There are two installation methods: Install and stage. This method is recommended to avoid copying files once.
AGcc
Bjam stage -- toolset = gcc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ GCC" release -- without-graph_parallel-- -***
Bjam stage -- toolset = gcc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ GCC" Debug -- without-graph_parallel-- -***
(-- Without-*** is a database that is not compiled, for example, -- without-Python -- without-wave -- without-MPI, all of which are compiled)
Or
Bjam stage -- toolset = gcc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ GCC" release -- without-graph_parallel -- -***
Bjam stage -- toolset = gcc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ GCC" Debug -- without-graph_parallel -- -***
(-- With-*** is a compiled library, for example, -- With-RegEx.-- With-filesystem)
B msvc (Open Visual Studio command)
Bjam stage -- toolset = msvc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ VC10" release -- -***
Bjam stage -- toolset = msvc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ VC10" Debug -- -***
Or
Bjam stage -- toolset = msvc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ VC10" release -- -***
Bjam stage -- toolset = msvc-sicu_path = "C: \ ICU" -- stagedir = "C: \ boost \ bin \ VC10" Debug -- -***
5) add boost library information to the IDE
Vs 2010 IDE (each project needs to be added separately, which is very troublesome)
1. Include path c: \ boost(Root DIR)
2. library path c: \ boost \ bin \ VC10 \ Lib(Lib dir)
3. Source Path c: \ boost(Include-file DIR)
Codeblocks
1. linker
Setting-> compiler and debuger-> global compiler setting-> linker setting->
Add(C: \ boost \ bin \ GCC \ *. A) (all the Lib files)
2. Search
Setting-> compiler and debuger-> global compiler setting-> search directories-> compiler->
Add (C: \ boost)(Root DIR)
6) for command line compilation, you can change the following BAT file:
A GCC
Set boost_root = c: \ boost
Set boost_lib = % boost_root % \ bin \ GCC \ Lib
Set use_boost =-I % boost_root %-l % boost_lib %
Set filesystem =-lboost_filesystem-mgw44-mt-d-1_46_1-lboost_system-mgw44-mt-d-1_46_1
Set RegEx =-lboost_regex-mgw44-mt-d-1_46_1
: Example
: G ++ Lex. cpp-O Lex % use_boost %
: G ++ regex_1.cpp-O regex_1 % use_boost % RegEx %
: G ++ traverse_dir.cpp-O traverse_dir_gcc_new % use_boost % filesystem %
BMsvc
Set boost_root = c: \ boost
Set boost_lib = % boost_root % \ bin \ VC10 \ Lib
Set use_boost =/ehs/ I % boost_root %/MD/link/libpath: % boost_lib %
: Example
: CL regex_1.cpp/feregex_1_vc.exe % use_boost %
: Del regex_1.obj
Of course, you can also write a makefile.