title: Compiling program containing extern "C"
body: <p>I'm trying to use a makefile to compile a program someone else has written, using cygwin. I get a lot of error messages, of which many complain <code>error: template with C linkage</code>.</p>
  
  <p>After searching around for a bit it seems the problem is connected to <code>extern "C"</code>. This line is contained in the file <em>cygwin/usr/include/pthread.h</em>, which is included with <code>#include &lt; pthread.h &gt;</code> in one of the headers. And when I remove this line most of the error messages disappear. But there are a few left, of the following sort: </p>
  
  <pre><code>/usr/include/pthread.h:67:5: error: previous declaration of ‘int pthread_atfork(void (*  )(),void ( *)(), void ( *)())’ with ‘C++’ linkage
  
  /usr/include/sys/unistd.h:136:5: error: conflicts with new declaration with ‘C’ linkage
  </code></pre>
  
  <p>Does anyone know how to fix this? I would love to sit down and learn all this stuff in detail but I don't have time before I need this program running..</p>