Linux compiler boost_1_55

Source: Internet
Author: User

Download the current boost library from www.boost.org, the current file name is: boost_1_55_0.tar.gz

Unzip at the current location.

Enter the extracted directory and execute the bootstarp.sh script.

./bootstarp.sh  

After running, the directories are B2 and Bjam, running B2.

are automatically installed into/usr/local/include and/usr/local/lib.

Print $path to see if it is in the path, if not, add it.

Also, see./b2--help

Choose the compilation criteria according to your needs.

1#include <iostream>2#include <boost/lexical_cast.hpp>3   4 intMain ()5 {  6     intNvalue = boost::lexical_cast<int> ("123456789"); 7std::cout<< Nvalue <<Std::endl; 8     return 0; 9}
View Code

Compile:

g++ Test.cpp-o Test  

If the number occurs after execution: 123456789 indicates success.

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.