pBook‎ > ‎BOOST C++‎ > ‎

Boost Installation Linux

posted Nov 22, 2014, 10:34 PM by Javad Taghia   [ updated Nov 22, 2014, 10:34 PM ]
Installation of boost libs on liunx is pretty easy. And we are able to set it up on Eclipse as shown in the video and followings.
1. you need to install it as:
sudo apt-get install libboost-all-dev
it takes a while.
2. Then copy the example below in a new project in eclipse.
#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main()
{
    std::string line;
    boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );

    while (std::cin)
    {
        std::cout<<"hi"<<std::endl;
        std::getline(std::cin, line);
        boost::smatch matches;
        if (boost::regex_match(line, matches, pat))
            std::cout << matches[2] << std::endl;
    }
}

3. now set the lib path:
    - right-click on the project select Properties/G++ Build/setting/CrossC++Linker/
    - press + on top window and add boost_xxx lib you want here we do it for boost_regex
    - now add path in the below window by +
    - boost is installed in filesystem usr/include
    - so set the path to /usr/include
    - now rebuild your project and should be okay.


YouTube Video



Comments