Linux under compile and install boost

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.