views:

95

answers:

0

I'm trying to create a simple test program using boost::thread, but I get a runtime assertion error.

Here is the code:

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

void hello (void) {
    std::cout << "Hello, world!" << std::endl;
}

int main (void) {
    boost::thread t(&hello);

    t.join(); // Fails even without this line
}

This is linked with the libboost_thread-mgw34-mt-d-1_44.a library.

The error that is printed is:

Assertion failed: px != 0, file ./boost/smart_ptr/intrusive_ptr.hpp, line 166

The program is being run on Windows XP 32-bit. It is compiled with the GNU GCC compiler packaged with the most recent version of Code::Blocks.