(This question uses zlib as an example but isn\'t specific to it.)
I\'m trying to compile zlib on Windows using the MSVC project file it comes with. I\'m using VS201
This question is old but if anyone still has this problem, I just succeded building latest zlib with msvc 12.0 targeting windows 7 by modifying the code in (iowin32.c file line 28) like so:
#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define IOWIN32_USING_WINRT_API 1
#endif
#endif
#endif
of course to make this work you need to define a macro in: configuration properties >C/C++ > preprocessor:
_WIN32_WINNT=0x0601
which means you're targeting windows 7 (if using windows 7 SDK this is not needed)
then rebuilding the project with success :) and yes, of course this fix is only aplicable if you're using a windows older than windows 8.
however this is not the only error that zlib has, you will for sure encounter a mismatched version in zlib.def file. to fix this open the zlib.def file that contains the error and replace 1.2.8 with 1.28 or whatever the version is