To compile and install the Linux platform in addition to GCC and gcc-c++, you need two development libraries: Bzip2-devel and Python-devel, so you should ensure that both libraries are installed before you install them:
#yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel-y
Then go to the official website to download the source package, address
To download, unzip, follow the steps below:
#tar Xvzf boost_1_50_0.tar.gz
Enter the Boost_1_50_0 directory:
#cd Boost_1_50_0
Then is the compilation installs, the boost source package has the configuration script, the direct use can:
#sh./bootstrap.sh
Building Boost.build engine with toolset gcc ... tools/build/v2/engine/bin.linuxx86_64/b2detecting Python version ... 2.6Detecting Python Root .../usrunicode/icu support for Boost.regex?... not found. Generating boost.build configuration in Project-config.jam ... Bootstrapping is done. To build, run: ./B2 To adjust configuration, edit ' Project-config.jam '. Further information: -Command line help: ./b2--help -Getting started Guide: http://www.boost.org/ more/getting_started/unix-variants.html -Boost.build Documentation: http://www.boost.org/boost-build2/ Doc/html/index.html
The next step is to compile and focus on the success of the compilation:
#./b2
Then there is the long wait, if the last appears:
The Boost C + + Libraries were successfully built! The following directory should is added to compiler include paths: /home/gang/bak/boost_1_50_0 the following dire Ctory should be added to linker library paths: /home/gang/bak/boost_1_50_0/stage/lib
1. Most of the libraries in boost are not compiled into dynamic or static link libraries.
2, only a few regex,thread and other libraries more trouble. To compile.
3. If you specify the path of the dynamic-link library with the GCC compiler-L, also specify the path to the header file.
4, or the linked boost library is placed after the. C or. cpp, otherwise the link cannot be passed, and the compilation can pass.
Hh.c-lboost_filesystem-lboost_thread
Linux under compile and install boost