Boost logo

Boost Users :

From: Raul Huertas (raulh39_at_[hidden])
Date: 2006-01-07 07:15:17

Brian Plummer escribió:

>The following simple program seg faults. (I have boiled it down to the
>bare essentials to product the fault:
I changed your test program to make compiler happy.

This is my modified version:
#include <boost/thread.hpp>

void MMULT2(void);
void MMULT2CalcMaster(void);

int main(void) {

class MMULT2ThreadClass {
void calculate(void) {}
public :
MMULT2ThreadClass() {}
void operator ()() { calculate(); }

void MMULT2CalcMaster(void) {
int numThreads = 2;
boost::thread_group threads;
for (int i = 0; i < numThreads; ++i)

void MMULT2(void) {
(I have changed "void *" to "void" in several places).

It works ok for me.

I've compiled with:
gcc -c -Wall -g \
-I/opt/boost_1_33_1/include -o _linux.O/bug.o

And I've linked with:
gcc -Wall -g -Ihdrs \
-I/opt/boost_1_33_1/include _linux.O/bug.o \
-o ../_linux.O/bug -L/opt/boost_1_33_1/lib \
-Wl,-rpath,/opt/boost_1_33_1/lib \
-lboost_thread-mt-d -lpthread -lstdc++

My gcc is 4.0.2.

Hope this helps.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at