I finally managed to solve my problem. For those who fall into such a problem, they understand how to solve it:
If you followed the tutorial in my first post, you would have removed ZLIB_WINAPI from the zlibstat project preprocessor . However, after setting up my own project (setting the ZLIB dependency path, LIB dependency libraries, etc.) that uses ZLIB, I "accidentally" included / defined the damned ZLIB_WINAPI macro in the header file that I use ZLIB, right before including "zlib .h ".
The curious thing is that when the application was launched in debug mode (which used dynamic linking), everything succeeded and worked like a charm, without any warnings or, HOWEVER, in the release mode (which used static linking), it crashed.
So, to clarify the situation, the tutorial tells us to remove the ZLIB_WINAPI preprocessor from the zlibstat project , which creates a static lib, while the zlibvc project has ZLIB_WINAPI in the preprocessor . In other words, this means that if we use different links for each configuration (debug / release), we must add the macro ZLIB_WINAPI or not!
Define the ZLIB_WINAPI macro before including "zlib.h" if you use dynamic linking (zlibwapi.lib) and that the zlibvc project remains unchanged (assuming that you followed the tutorial correctly from the link above), and do not define it if you removed ZLIB_WINAPI from the zlibstat project (as our tutorial says)!
One useful macro that I used in my own project is as follows:
// Since we used dynamic linking for debug, we have to define the ZLIB_WINAPI
Things are really confused, and I really hope that I was clear enough.