title: Boost's thread group on Xcode
body: <p>I was trying to run a small test program on Xcode (4.2) using C++ after encountering error in my project.</p>
  
  <pre><code>#include &lt;boost/thread.hpp&gt;
  #include &lt;boost/bind.hpp&gt;    
  
  int main (int argc, const char * argv[])
  {
      boost::thread_group tg;
      return 0;
  }
  </code></pre>
  
  <p>But the whole program fails to build, outputting error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "boost::thread::~thread()", referenced from:
        boost::thread_group::~thread_group()in main.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Then I tried using </p>
  
  <pre><code>thread_group * tg = new thread_group();
  </code></pre>
  
  <p>which compiles without issue, up until I tried to invoke</p>
  
  <pre><code>tg-&gt;join_all();
  </code></pre>
  
  <p>where the compiler outputs errors such as:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "boost::detail::get_current_thread_data()", referenced from:
        boost::detail::interruption_checker::interruption_checker(_opaque_pthread_mutex_t*, _opaque_pthread_cond_t*)in main.o
    "boost::this_thread::interruption_point()", referenced from:
        boost::condition_variable::wait(boost::unique_lock&lt;boost::mutex&gt;&amp;) in main.o
    "boost::this_thread::disable_interruption::disable_interruption()", referenced from:
        boost::shared_mutex::lock_shared()      in main.o
    "boost::this_thread::disable_interruption::~disable_interruption()", referenced from:
        boost::shared_mutex::lock_shared()      in main.o
    "boost::thread::join()", referenced from:
        boost::thread_group::join_all()     in main.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Does anyone know how to resolve these issues ? I've been using other functions such as BOOST_FOREACH without any issues. But encounter these while trying to use threads.</p>
  
  <p>Do I need to:</p>
  
  <ul>
  <li>Specify flags on my 'Other Linker Flags'?</li>
  <li>reinstall boost or some sort ? Currently I am using Boost 1.49.0, installed using homebrew (i.e. sudo brew install boost)</li>
  </ul>
  
  <p>Or are there any other specific configurations that I need to to include ?</p>