I figured out what caused that error. One of the include paths (passed to a compiler with the /I switch) had a trailing backslash.
The compiler cmdline is: CPP /nologo /MT /W3 /GX /Zi /Od /I "$(ZLIB_PATH)" /I "..\headers"
and ZLIB_PATH
had a trailing backshlash. Removing that backslash solved the problem.