Using boost in Visual Studio

Source: Internet
Author: User

1. Download boost's Windows distribution to boost official web. Assuming it's boost_1_58_0.7z.

2. Decompression, get Boost_1_58_0 directory

3. Create the directory C:\Program files\boost, move the boost_1_58_0 directory you extracted from the previous step to the newly created directory.

4. Open Visual Studio and create a new C + + project

5. Open the properties of the project, configure properties->c/c++->general->additional include Directories, add C:\Program here Files\boost\boost_1_58_0

6. Write test code and compile

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main ()
{
    using namespace Boost::lambda;
    typedef std::istream_iterator<int> in;

    Std::for_each (
        in (Std::cin), in (), Std::cout << (_1 * 3) << "");


Note: If you follow the steps above, you will not be able to compile your program, then you need to compile boost, please refer to the following official website article.

Reference: Search on Google for "install boost to Visual Studio" and find the article "boost Getting started on Windows" at Boost's website

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.