|
Boost Users : |
From: Rij (rij.ghosh_at_[hidden])
Date: 2007-11-23 20:34:06
Hello,
I am having problems with running a threads program and was windering
if someone could help.
I have the following 3 files.
1) example.h
class example{
public:
example();
virtual ~example();
void operator()();
void someOtherFn();
};
2) example.cc
#include "example.h"
C_example::C_example() {
}
C_example::~C_example() {
}
void C_example::operator()() {
cout << "I'm thread\n";
}
3) main.cc
#include <boost/thread/thread.hpp>
#include "example.h"
int main(int argc, char* argv[]) {
example e;
boost::thread t1(e);
t1.join();
return 0;
}
I have compiled this and linked with: -lboost_thread-gcc-mt
When I run it, I get the following error:
terminate called after throwing an instance of 'boost::thread_resource_error'
what(): boost::thread_resource_error
Abort (core dumped)
Any help please?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net