|
Boost Users : |
From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-07-07 09:57:41
Tristan King wrote:
> i've written a little test to see if i've installed boost properly on my mac
>
> #include <boost/thread.hpp>
> #include <boost/shared_ptr.hpp>
> #include <boost/bind.hpp>
>
> #include <iostream>
>
> void simple_thread( boost::shared_ptr<int> p )
> {
> std::cout << (*p) << std::endl;
> }
>
> int main (int argc, char * const argv[]) {
>
> boost::thread_group threads;
> for ( int i = 0 ; i < 5 ; i++ )
> {
> boost::shared_ptr<int> p( new int(i) );
> threads.create_thread( boost::bind( &simple_thread, p ) );
> }
>
> threads.join_all( );
>
> return 0;
> }
>
> in xcode (a C++ Tool project) this compiles fine, however on runtime i
> get the following error:
> ZeroLink: unknown symbol '__ZN5boost12thread_groupC1Ev'
> boost_test has exited due to signal 6 (SIGABRT).
>
> using g++ i get the following errors (ignoring warnings)
> g++ main.cpp -o boost_test -I/usr/local/include/boost-1_31 -L/usr/local/lib
> ld: Undefined symbols:
> boost::thread_group::create_thread(boost::function0<void,
> std::allocator<boost::function_base> > const&)
> boost::thread_group::join_all()
> boost::thread_group::thread_group[in-charge]()
> boost::thread_group::~thread_group [in-charge]()
>
> i originally built boost using the command line
> sudo bjam -sTOOLS=darwin install
>
> can anyone help me with what i am missing here?
I'm not familiar with the platform, but it sounds like you've either not
built the Boost.Threads library or that it's not being found.
Boost.Threads is one of the few Boost libraries that is not a
header-only library.
Mike
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