title: how to call a thread member function from main ( )
body: <p>I'm getting errors while compiling a program that uses threads. Here is the part that is causing problems.It would be nice if anybody told me if I'm calling the thread function in the right way .</p>
  
  <p>In main.cpp:</p>
  
  <pre><code>int main() 
  {
      WishList w;
      boost::thread thrd(&amp;w.show_list);
      thrd.join();
  }
  </code></pre>
  
  <p>In another_file.cpp:</p>
  
  <pre><code>class WishList{
  public:
        void show_list();
  }
  
  void WishList::show_list(){
          .
          .
          .
          .
  }
  </code></pre>
  
  <p>I'm getting the following error</p>
  
  <pre><code>error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function.  Say ‘&amp;WishList::show_list’
  
  /home/sharatds/Downloads/boost_1_46_1/boost/thread/detail/thread.hpp: In member function ‘void boost::detail::thread_data&lt;F&gt;::run() [with F = void (WishList::*)()]’:
  
  /home/sharatds/Downloads/boost_1_46_1/boost/thread/detail/thread.hpp:61:17: error: must use ‘.*’ or ‘-&gt;*’ to call pointer-to-member function in ‘((boost::detail::thread_data&lt;void (WishList::*)()&gt;*)this)-&gt;boost::detail::thread_data&lt;void (WishList::*)()&gt;::f (...)’, e.g. ‘(... -&gt;* ((boost::detail::thread_data&lt;void (WishList::*)()&gt;*)this)-&gt;boost::detail::thread_data&lt;void (WishList::*)()&gt;::f) (...)’
  </code></pre>
  
  <p>EDIT : Having problems installing Boost library for threads. Shall try this as soon as it works</p>