title: zlib and minizip linking errors
body: <p>My project requires me to have an unzipping functionality in C++ common for both Windows and Mac. I tried a source code from the internet which includes zlib library I am not sure if this will work for Mac), but I am getting a lot of linking errors. </p>
  
  <pre><code>1&gt;------ Build started: Project: ZipFile, Configuration: Debug Win32 ------
  1&gt;  zipper.cpp
  1&gt;  ZipFile.cpp
  1&gt;  unzipper.cpp
  1&gt;  stdafx.cpp
  1&gt;  Generating Code...
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzOpen64 referenced in function "public: bool __thiscall ziputils::unzipper::open(char const *)" (?open@unzipper@ziputils@@QAE_NPBD@Z)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzClose referenced in function "public: void __thiscall ziputils::unzipper::close(void)" (?close@unzipper@ziputils@@QAEXXZ)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzGetGlobalInfo64 referenced in function "private: void __thiscall ziputils::unzipper::readEntries(void)" (?readEntries@unzipper@ziputils@@AAEXXZ)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzGoToNextFile referenced in function "private: void __thiscall ziputils::unzipper::readEntries(void)" (?readEntries@unzipper@ziputils@@AAEXXZ)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzLocateFile referenced in function "public: bool __thiscall ziputils::unzipper::openEntry(char const *)" (?openEntry@unzipper@ziputils@@QAE_NPBD@Z)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzGetCurrentFileInfo64 referenced in function "public: unsigned int __thiscall ziputils::unzipper::getEntrySize(void)" (?getEntrySize@unzipper@ziputils@@QAEIXZ)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzOpenCurrentFile referenced in function "public: bool __thiscall ziputils::unzipper::openEntry(char const *)" (?openEntry@unzipper@ziputils@@QAE_NPBD@Z)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzCloseCurrentFile referenced in function "public: void __thiscall ziputils::unzipper::closeEntry(void)" (?closeEntry@unzipper@ziputils@@QAEXXZ)
  1&gt;unzipper.obj : error LNK2019: unresolved external symbol _unzReadCurrentFile referenced in function "public: class ziputils::unzipper &amp; __thiscall ziputils::unzipper::operator&gt;&gt;(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;)" (??5unzipper@ziputils@@QAEAAV01@AAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
  1&gt;zipper.obj : error LNK2019: unresolved external symbol _zipOpen64 referenced in function "public: bool __thiscall ziputils::zipper::open(char const *,bool)" (?open@zipper@ziputils@@QAE_NPBD_N@Z)
  1&gt;zipper.obj : error LNK2019: unresolved external symbol _zipOpenNewFileInZip referenced in function "public: bool __thiscall ziputils::zipper::addEntry(char const *)" (?addEntry@zipper@ziputils@@QAE_NPBD@Z)
  1&gt;zipper.obj : error LNK2019: unresolved external symbol _zipWriteInFileInZip referenced in function "public: class ziputils::zipper &amp; __thiscall ziputils::zipper::operator&lt;&lt;(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;)" (??6zipper@ziputils@@QAEAAV01@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z)
  1&gt;zipper.obj : error LNK2019: unresolved external symbol _zipCloseFileInZip referenced in function "public: void __thiscall ziputils::zipper::closeEntry(void)" (?closeEntry@zipper@ziputils@@QAEXXZ)
  1&gt;zipper.obj : error LNK2019: unresolved external symbol _zipClose referenced in function "public: void __thiscall ziputils::zipper::close(void)" (?close@zipper@ziputils@@QAEXXZ)
  1&gt;c:\users\ashraya\documents\visual studio 2015\Projects\ZipFile\Debug\ZipFile.exe : fatal error LNK1120: 14 unresolved externals
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>I have added zlib.lib and zlibstatic.lib compiled for x86 platform in debug mode (and release mode respectively) in Linker->Input->Additional Dependencies</p>
  
  <p>Added the paths to the include directories in Linker->General->Additional Library Directories</p>
  
  <p>Added the same include paths in C/C++ ->General->Additional Include Directories</p>
  
  <p>I am nore sure where I am going wrong. I read other posts in the internet and found that I need to add </p>
  
  <pre><code>#ifdef _WIN32
  #define ZLIB_WINAPI
  #endif
  </code></pre>
  
  <p>for windows. But I am not sure if the code will compile in Mac since this flag will not be valid for Mac. Anyways, adding the flag didn't solve the linking errors. The errors seem to be from Minizip but I am not able to resolve them.</p>
  
  <p>Can anyone please help?</p>
  
  <p>Thanks a lot, in advance.</p>
  
  <p>Esash</p>