Boost logo

Boost Users :

Subject: Re: [Boost-users] Error compiling boost:interprocess
From: Alexander Maslowski (alexmas_at_[hidden])
Date: 2010-02-08 14:34:21


It seems that the compiler can't find boost/thread.hpp, and from the
compile line you seem to be missing something that specifies the
include directory location, something along the lines:
g++ -c -g -MMD -MP -MF -I/$BOOST_DIR/include
build/Debug/GNU-Solaris-x86/main.o.d -o
build/Debug/GNU-Solaris-x86/main.o main.cpp

Hope this helps,

--Alex

On Mon, Feb 8, 2010 at 11:23 AM, Daniel Veneros <dann.vd_at_[hidden]> wrote:
> 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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Alexander E. Maslowski
(253) - 376 - 2730

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