title: Using pthread in c++
body: <p>I am using <code>pthread.h</code> in a <code>*.cc</code> file. when I try to use <code>pthread_exit(0);</code> or <code>pthread_join(mythrds[yy],NULL);</code> it says:</p>
  
  <pre><code>.cc:(.text+0x3e): undefined reference to `pthread_exit'
  </code></pre>
  
  <p>when complied very similar code in a <code>*.c</code> file with  gcc it work perfect. How Can I use pthread's in c++.. (I also added -lpthread)</p>
  
  <pre><code>..
  void *myThreads ( void *ptr )
  {
  ...
  pthread_exit(0); 
  }
  ..
  </code></pre>
  
  <p>flags:</p>
  
  <pre><code>g++ -lpthread -Wall -static -W -O9 -funroll-all-loops -finline -ffast-math
  </code></pre>