Boost logo

Boost Users :

Subject: [Boost-users] Error compiling boost:interprocess
From: Daniel Veneros (dann.vd_at_[hidden])
Date: 2010-02-08 14:23:43


Hi,
I'm doing a program that uses threads to launch a function using threads.
I implemented the following code:

#include <iostream>

#include <boost/thread.hpp>

void NewFunc()

{

    std::cout << "NewFunc running" << std::endl;

    //do something

    std::cout << "NewFunc finished" << std::endl;

}

int main(int argc, char* argv[])

{

    boost::thread FuncThread(NewFunc);

    FuncThread.join();

}

And I receive a few errors:

g++ -c -g -MMD -MP -MF build/Debug/GNU-Solaris-x86/main.o.d -o
build/Debug/GNU-Solaris-x86/main.o main.cpp

main.cpp: In function `int main(int, char**)':

main.cpp:19: error: `boost' has not been declared

main.cpp:19: error: `thread' undeclared (first use this function)

main.cpp:19: error: (Each undeclared identifier is reported only once for
each function it appears in.)

main.cpp:19: error: expected `;' before "FuncThread"

main.cpp:20: error: `FuncThread' undeclared (first use this function)

Any idea why this is failing?

Thanks



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