Compile and install boost-Ubuntu and use it in eclipse C/C ++.

Source: Internet
Author: User
1. Download boost 1.46.1 from the boost official website.

2. Run Apt-Get install build-essential (The purpose is to install some tools such as GCC and G ++ for compilation)
Note: I perform operations under the root user. Sudo apt-Get install build-essential

  • ./Is the prefix of the UNIX-like system execution file, which is used to execute the bjam file.
      • -A is a parameter, which indicates rebuild ). Enter./bjam-H for more help.
      • -Shave_icu = 1, which indicates Unicode/ICU is supported. Click Here (http://goo.gl/ySEe) premise: the system needs to install libicu-Dev, you can enter in the terminal: sudo apt-Get install libicu-Dev
      • Install, indicating Installation
      • -- Clean indicates cleaning. If the current statement contains-A, you do not need to clear it manually. Otherwise, you need to run./bjam -- clean first.
      1. If you execute the previous step, there will be problems such as: MPI, most of which is that MPI is not installed on the local machine. Depending on the system prompts, you can find/home/volnet/sourcecode/boost_1_42_0/tools/build/v2/user-config.jam. Keep up with the file

        Using MPI;

        You can. If the MPI problem persists, it indicates that MPI is not installed on the local machine.

        Sudo apt-Get install MPI-default-Dev
      2. This should be compiled smoothly. The boost library is available in/usr/local/lib.
        The following describes how to link static link libraries in eclipse.
        The unix variants wizard provides a regular expressionProgram.
        In eclipse, C ++ project is added and the Linux C ++ compiler is used. SetCodeCopy to file:
        As you need to statically link to the Regular Expression Library, set the corresponding *. A file path to eclipse, as shown in, so that the linker can find it.
         

        Compiled!
        In order for our programs to load correctly, we need to allow our programs to find our libraries within our system. At this time, we need to set it. For more information, see this section.
        Test program!

    Www.linuxidc.com @ Ubuntu :~ /Workspace/boost_get_started/debug $./boost_get_started <Test
    Will success spoil Rock Hunter?

    Here, test is a file.

    Reference: http://blog.csdn.net/dainiao01/article/details/6340472

  • 2. Run Apt-Get install build-essential (The purpose is to install some tools such as GCC and G ++ for compilation)
    Note: I perform operations under the root user. Sudo apt-Get install build-essential

  • ./Is the prefix of the UNIX-like system execution file, which is used to execute the bjam file.
      • -A is a parameter, which indicates rebuild ). Enter./bjam-H for more help.
      • -Shave_icu = 1, which indicates Unicode/ICU is supported. Click Here (http://goo.gl/ySEe) premise: the system needs to install libicu-Dev, you can enter in the terminal: sudo apt-Get install libicu-Dev
      • Install, indicating Installation
      • -- Clean indicates cleaning. If the current statement contains-A, you do not need to clear it manually. Otherwise, you need to run./bjam -- clean first.
      1. If you execute the previous step, there will be problems such as: MPI, most of which is that MPI is not installed on the local machine. Depending on the system prompts, you can find/home/volnet/sourcecode/boost_1_42_0/tools/build/v2/user-config.jam. Keep up with the file

        Using MPI;

        You can. If the MPI problem persists, it indicates that MPI is not installed on the local machine.

        Sudo apt-Get install MPI-default-Dev
      2. This should be compiled smoothly. The boost library is available in/usr/local/lib.
        The following describes how to link static link libraries in eclipse.
        In the unix variants wizard, a program using regular expressions is officially provided.
        In eclipse, C ++ project is added and the Linux C ++ compiler is used. Copy the code to the file:
        As you need to statically link to the Regular Expression Library, set the corresponding *. A file path to eclipse, as shown in, so that the linker can find it.
         

        Compiled!
        In order for our programs to load correctly, we need to allow our programs to find our libraries within our system. At this time, we need to set it. For more information, see this section.
        Test program!

    Www.linuxidc.com @ Ubuntu :~ /Workspace/boost_get_started/debug $./boost_get_started <Test
    Will success spoil Rock Hunter?

    Here, test is a file.

    Reference: http://blog.csdn.net/dainiao01/article/details/6340472

  • Related Article

    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.