Preconditions required to install zlib: cmake, VS 2022 (other versions are also available)
The installation of cmake can be seen: Installation and configuration of CMake in windows
Step 1: Download the zlib library source file
Download the zlib library source file, you can go to the official website to download it, or you can go to github to download it, here we recommend GitHub download
GitHub URL: Click the green Code button, click Download Zip at the bottom to download GitHub - madler/zlib: A massively spiffy yet delicately unobtrusive compression library.
Command line input: the effect is the same as the above URL method, just choose one of the two
Click win+R, enter cmd, and enter the following code
git clone https://github.com/madler/zlib.git
Step 2: Use cmake to configure zlib
There are two ways to open cmake-gui
Method 1: Win+R input cmd to open the command line, input cmake-gui in the command line can directly open the application interface
Method 2: Find the folder where you installed cmake at the beginning, and double-click cmake-gui in the bin subfolder to open it
After the application opens, enter the location of the zlib source file and the location of the build folder
Among them, the build folder needs to create an empty folder by itself, and generally choose to build it under the directory of the source file
Don't worry about the red above, click the three buttons below in turn from left to right
Another: If the red color still exists after clicking configure, you need to click the red color to configure the required pre-path above.
Step 3: Install zlib using VS2022
After clicking Open Project above, it will automatically open VS2022, find the INSTALL sub-item, right-click to set it as the startup item
After setting it as a startup item, right-click again to generate, if it is displayed as the following figure, it means the installation is successful
Step 4: Check whether zlib is installed and configured successfully
Open the program file folder of the C drive, and if there is a zlib folder, it means the installation is successful