Skip to content

Instantly share code, notes, and snippets.

@davidcorbin
Created February 9, 2016 05:43
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidcorbin/0b13604900089b8fcb28 to your computer and use it in GitHub Desktop.
Save davidcorbin/0b13604900089b8fcb28 to your computer and use it in GitHub Desktop.
How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

Install ZLIB

Download ZLIB for Windows from Sourceforge and install it on your Windows machine. Works with x86/x64

Find ZLIB install directory

Currently, the ZLIB installer from Sourceforge (above) installs in C:/Program Files (x86)/GnuWin32.

Setup cmake-gui variables

Run cmake-gui to open the cmake gui and choose your source and build directories. Check Abvanced and ckeck if ZLIB_LIBRARY or ZLIB_INCLUDE_DIR have entries in the left column. If the entry is not a directory, replace whatever is in the right hand column with the directory you found in step 2 and append /bin to the end of the ZLIB_LIBRARY and append /include to the ZLIB_INCLJDE_DIR directory. It should look something like this.

Hope this helps!

@habi498
Copy link

habi498 commented May 15, 2022

thank you

@issaclin32
Copy link

Thanks. This helps a lot.

@JackJosue517
Copy link

Merci infiniment.
Cela m'a beaucoup aidé

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment