title: undefined reference to `pthread_create'
body: <p>I have client server code. LinServer.cpp using pthread to continuously listen client. I created make file to compile all togather:</p>
  
  <pre><code>all: LinServer LinClient
  
      LinServer:
      g++ LinServer.cpp -o LinServer -pthread
  
      LinClient:
      g++ LinClient.cpp -o LinClient -pthread
  </code></pre>
  
  <p>I also tried with -lpthread but same error:</p>
  
  <pre><code>LinServer.cpp:(.text+0x29b): undefined reference to `pthread_create'
  LinServer.cpp:(.text+0x2a7): undefined reference to `pthread_detach'
  collect2: error: ld returned 1 exit status
  make: *** [LinServer] Error 1
  </code></pre>
  
  <p>Any idea what's the problem here?</p>