title: no reference to pthread_mutex_lock with -lpthread compiled
body: <p>I am compiling a program that contains mutex semaphores from the pthread library but when i compile using the -lpthread flag I am getting an undefined reference error. </p>
  
  <pre><code>gcc -lpthread prodcon.c
  /tmp/ccESOlOn.o: In function `producer':
  prodcon.c:(.text+0x2e): undefined reference to `pthead_mutex_lock'
  prodcon.c:(.text+0xd6): undefined reference to `pthead_mutex_unlock'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>The syntax for the mutex lock is like so:</p>
  
  <pre><code>pthread_mutex_t mutex1;
  </code></pre>
  
  <p>is a global declaration so that it can be used by multiple threads. within the functions I am calling the mutex like so:</p>
  
  <pre><code>pthead_mutex_lock(&amp;mutex1);
  pthead_mutex_unlock(&amp;mutex1);
  </code></pre>
  
  <p>But i am getting the compiler error, I also tried compiling with the -pthread flag</p>
  
  <pre><code>gcc -pthread prodcon.c
  /tmp/cc6wiQPR.o: In function `producer':
  prodcon.c:(.text+0x2e): undefined reference to `pthead_mutex_lock'
  prodcon.c:(.text+0xd6): undefined reference to `pthead_mutex_unlock'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I have searched for answers but am at a loss and would appreciate any help with figuring out why it has an undefined reference when I am linking in the library that contains the mutex locks.</p>