Results 1 to 1 of 1
Hi All,
I posted my issue regarding boost error bfore but didn't any reply.
I actually trying to compile boost thread programs.I m using boost 1.37 in ubuntu 7.10.On compilation ...
- 01-21-2009 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 9
boost error
Hi All,
I posted my issue regarding boost error bfore but didn't any reply.
I actually trying to compile boost thread programs.I m using boost 1.37 in ubuntu 7.10.On compilation like this
g++ -o second boostThread.cpp -L/usr/lib -lboost_thread
/////////////////Here is my program////////
#include <exception>
#include <boost/thread/thread.hpp>
#include <stdlib.h>
using namespace std;
class callable {
public:
void run() {
try {
//std::cout << "Throwing" <<std:: endl;
throw string("error");
} catch(string &e) {
//cout << "Error: " << e << endl;
}
}
void operator()() {
this->run();
}
};
int main() {
callable c;
boost::thread thd(boost::ref(c));
thd.join();
return 0;
}
it's showing error like
/usr/bin/ld: cannot find -lboost-thread
collect2: ld returned 1 exit status
normal programs like
#include <boost/lambda/lambda.hpp>
#include <boost/thread/thread.hpp>
#include <exception>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
//cout<<"Hi..\n";
//std::for_each(
// in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
running well.
Can any plz suggest me.
Thanks.
Bijay.


Reply With Quote