title: protocol buffers + zlib = unresolved external symbol
body: <p>My program (VS 2010) uses Google Buffer Protocol compiled with <code>HAVE_ZLIB</code> option enabled. I compiled the latest version of <code>zlib</code> and added <code>.lib</code> in my project, but during linking i still got</p>
  
  <blockquote>
    <p>1>libprotobuf.lib(gzip_stream.obj) : error LNK2001: unresolved
    external symbol _inflateEnd 1>libprotobuf.lib(gzip_stream.obj) : error
    LNK2001: unresolved external symbol <em>inflateInit2</em>
    1>libprotobuf.lib(gzip_stream.obj) : error LNK2001: unresolved
    external symbol _inflate 1>libprotobuf.lib(gzip_stream.obj) : error
    LNK2001: unresolved external symbol <em>deflateInit2</em>
    1>libprotobuf.lib(gzip_stream.obj) : error LNK2001: unresolved
    external symbol _deflate 1>libprotobuf.lib(gzip_stream.obj) : error
    LNK2001: unresolved external symbol _deflateEnd</p>
  </blockquote>
  
  <p>I used <code>dumpbin.exe /all zlib.lib</code>, it says:</p>
  
  <blockquote>
    <p>File Type: LIBRARY</p>
  
  <pre><code>....
  
  245 public symbols
  
  ....
  
   4DBE __imp__inflateInit2_@16
   4DBE _inflateInit2_@16
  </code></pre>
  </blockquote>
  
  <p>also there are other unresolved symbols in this list.</p>
  
  <p>What's wrong then? Why does the linker can't find these functions?</p>
  
  <p><strong>upd:</strong> after recompiling <code>zlib</code> now it's <code>__imp__inflateInit2_@4</code></p>