title: Code::Blocks pthread example can not compile
body: <p>Maybe this questions is easy but I can't figure it out how to resolve it:
  I try to compile an example which has <code>pthreas</code> on <strong>windows 7</strong> (64bit), with <strong>Code Blocks</strong> I downloaded the prebuild library and set up <strong>building_options</strong>: the path for the compiler <code>pthreadLib\include</code> and the linker to <code>pthreadLib\lib\x64</code>
  The program is:</p>
  
  <pre><code>extern "C"
   {
      #include &lt;pthread.h&gt;
      #include &lt;unistd.h&gt;
   }
  #include &lt;iostream&gt;
  #include &lt;windows.h&gt;
  
  using namespace std ;
  
  void  * function1(void * argument);
  void  * function2(void * argument);
  
  int main( void )
  {
      pthread_t t1, t2 ; // declare 2 threads.
  
      pthread_create( &amp;t1, NULL, function1,NULL); // create a thread running function1
      pthread_create( &amp;t2, NULL, function2,NULL); // create a thread running function2
  
      Sleep(1);
  
      return 0;
  }
  
  void * function1(void * argument)
  {
      cout &lt;&lt; " hello " &lt;&lt; endl ;
      Sleep(2); // fall alseep here for 2 seconds...
      return 0;
  }
  
  void * function2(void * argument)
  {
      cout &lt;&lt; " world "  &lt;&lt; endl ;
      return 0;
  }
  </code></pre>
  
  <p>In case I comment <code>pthread_create();</code> function, than it builds. So <code>pthread_t</code> is recognized as a type. 
  When I try to compile with <code>pthread_create</code> I get an error:</p>
  
  <pre><code>mingw32-g++.exe -L..\libs\Pre-built.2\lib\x64 -LD:\DropBox\WorkUT\Programs\MyODP\libs -o bin\Release\RIP.exe obj\Release\main.o  -s  ..\libs\Pre-built.2\lib\x64\libpthreadGC2.a ..\libs\Pre-built.2\lib\x64\pthreadVC2.lib
  obj\Release\main.o:main.cpp:(.text.startup+0x36): undefined reference to `_imp__pthread_create'
  collect2.exe: error: ld returned 1 exit status
  Process terminated with status 1 (0 minute(s), 0 second(s))
  1 error(s), 1 warning(s) (0 minute(s), 0 second(s))
  </code></pre>
  
  <p>Do I have to make additional setups in <code>C::B</code>? I tired to add the linker command <code>-lpthread</code> but is not recognized.</p>