0

I am learning boost c++ and thus I was trying this piece of code which deals with boost threads

#include <boost/thread.hpp>
#include <boost/chrono.hpp>
#include <iostream>

void wait(int seconds)
{
    boost::this_thread::sleep_for(boost::chrono::seconds(seconds));
}

void thread()
{
    for(int i = 0; i < 5; i++)
    {
        wait(2);
        std::cout << i << std::endl;
    }
}

int main()
{
    boost::thread t(thread);
    t.join();

    return 0;
}

But when I compile this code on VS2008 I get the following errors:

LINK : fatal error LNK1104: cannot open file 'boost_thread-vc90-mt-1_58.lib'

What I understood is this error is due to configuration issues but I don't know how to get rid of it. Can somebody help me in solving this error?

NIXIN
  • 21
  • 5

1 Answers1

0

First of all you need to compile boost (if you didn't).

Secondly you need to properly add this library to project, look at this answer.

Community
  • 1
  • 1
artursg
  • 66
  • 5