Build Boost Library under Windows

Source: Internet
Author: User

Download source code

boost_1_66_0.7z

Generate compilation Tools

D:\Project\boost_1_66_0> bootstrap.bat

Configuring the Python environment variable (using the 32-bit python3 that VS2017 comes with)


Compiling a 32-bit boost library

D:\Project\boost_1_66_0> .\b2 install architecture=x86 address-model=32 --with-system --with-thread --with-date_time --with-regex --with-serialization --with-python link=static runtime-link=shared threading=multi debug

Create an empty project using virtual Studio 2017 and then add the source file

#include <iostream>#include <boost/asio.hpp>#include <boost/date_time/posix_time/posix_time.hpp>void print(const boost::system::error_code& /*e*/){    std::cout << "Hello, world!" << std::endl;}int main(){    boost::asio::io_context io;    boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));    t.async_wait(&print);    io.run();    system("PAUSE");    return 0;}

Set up the Include directory for the project (Project->c/c++->, add-in directory, general)

Set up the project's library directory (add-in library directory, general---linker, project--)

Set up a library file for the project that needs to be linked (add-on dependency, input, project, linker, and so on)

Compiling the Run project (CTRL+F5)

Build Boost Library under Windows

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.