title: Why am I getting error LNK2001 when linking to zlib.lib?
body: <p>I'm working on a project that already contains the <a href="http://www.gzip.org/" rel="nofollow noreferrer">gzip</a> library as follows:  </p>
  
  <pre><code>zlib\zlib.h  
  zlib\zlib.lib
  zlib\zconf.h  
  </code></pre>
  
  <p>I would like to use the gzip functions from this .lib but am getting the following <a href="http://msdn.microsoft.com/en-us/library/f6xx1b1z%28VS.71%29.aspx" rel="nofollow noreferrer">errors</a>:</p>
  
  <pre><code>Compress.cpp
  Linking...
  Compress.obj : error LNK2001: unresolved external symbol _gzclose
  Compress.obj : error LNK2001: unresolved external symbol _gzerror
  Compress.obj : error LNK2001: unresolved external symbol _gzwrite
  Compress.obj : error LNK2001: unresolved external symbol _gzopen
  .\Debug/files.exe : fatal error LNK1120: 4 unresolved externals
  Error executing link.exe.  
  </code></pre>
  
  <p>The link settings include:<br>
  Object/library modules: zlib.lib<br>
  Project Options:<br>
  zlib.lib   </p>
  
  <p>In the file using the gzX() functions, it </p>
  
  <pre><code>#include "zlib/zlib.h"
  </code></pre>
  
  <p>What else needs to be done here to use these functions?  </p>
  
  <p>Thank You.</p>
  
  <p><strong>EDIT</strong>: Using Visual Studio 6.0 C++</p>
  
  <p><strong>EDIT2</strong>: It turned out the static library I was using had the gz() functions taken out of them. The header file still had them which was misleading. </p>