title: How do I use zlib within windows using CMake and Mingw?
body: <p>My environment is using CLion, running CMake and Mingw. </p>
  
  <p>I need to use zlib in my project, but I can't for the life of me get it to link in windows.</p>
  
  <p>If I follow the solution of <a href="https://stackoverflow.com/questions/36126333/mingw-cmake-undefined-reference-to-zlib">this stackoverflow article</a> , attempting to just build the zlib example binaries, with the exact cmakelists as in the mentioned article, I receive the error:</p>
  
  <p><code>
    Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)
  </code></p>
  
  <p>I also was unable to find a precompiled binary for zlib on the official zlib website, which the zlib's own documentation states should exist on the site, so trying to just link that on my project has been difficult.</p>
  
  <p>I did find some binaries, but on attempting to link them, (Which, I'm still trying to figure out how to link a dll with cmake, so that may be part of the issue), the make system just nopes out.</p>
  
  <p><code>
  mingw32-make.exe[1]: *** [CMakeFiles/CMinecraft.dir/rule] Error 2
  mingw32-make.exe: *** [CMinecraft] Error 2
  CMakeFiles\Makefile2:153: recipe for target 'CMakeFiles/CMinecraft.dir/rule' failed
  </code></p>