Calling a class member function from a thread using pthread_create
<p>Below is the code </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;pthread.h&gt;

using namespace std;

class Base

{
    private:
    public:

        void *threadCall1( void * value)
        {
            cout&lt;&lt;"inside threadCall1"&lt;&lt;endl;

        }

    protected:

};

class Derived
{
    private:
    public:
        void  *threadCall2 ();
    protected:



};


 void *Derived::threadCall2()
{
    cout&lt;&lt;"inside threadCall2"&lt;&lt;endl;

}
int main ()
{
    int k = 2;
    pthread_t t1;
    cout&lt;&lt;"inside main"&lt;&lt;endl;
    Base *b = new Base();

    pthread_create(&amp;t1,NULL,&amp;b-&gt;threadCall1,(void *)k);

    return 0;
}
</code></pre>

<p><strong>Error</strong></p>

<blockquote>
  <p>main.cc: In function <code>int main()': main.cc:46: error: ISO C++ forbids
  taking the address of a bound member function to form a pointer to
  member function.  Say</code>&amp;Base::threadCall1' main.cc:46: error: cannot
  convert <code>void*(Base::*)(void*)' to</code>void*(<em>)(void</em>)' for argument <code>3'
  to</code>int pthread_create(pthread_t*, const pthread_attr_t*,
  void*(<em>)(void</em>), void*)'</p>
</blockquote>

<p>I agree C++ forbids this call but is there any way I can call a class member function using posix thread</p>