[Zlib-devel] visual studio linking against msvcrt.dll

William A. Rowe Jr. wrowe at rowe-clan.net
Sun Mar 28 19:26:59 EDT 2010


On 3/28/2010 4:58 PM, Berke Viktor wrote:
> helo,
> 
> there are vc9 and vc10 solutions in the zlib source tree. this makes it
> easy to build the zlib libraries. there's one problem, however: they
> link against msvcr90.dll (with vc9). that means, they won't work on xp
> until the vcredist package is installed. xp only has msvcrt.dll.

As long as they link against msvcr100.dll (with vc10), this is good...

> this can be solved by updating the solutions to use the windows driver
> kit libs and headers. this causes the build to link against the old
> msvcrt.dll found in windows xp.
> 
> more info: http://winbuild.daydreamer.nu/

If they are building a vc9 or vc10 projects, they have the vcredist package,
and if they are delivering projects, they are shipping those libraries.  They
must install such libraries to use the rest of their projects.

There is a substantial flaw with the proposed solution, of course it is
possible to generate import headers, but this 1) ignores Microsoft's warning
that msvcrt.dll is for internal consumption, going forwards (as illustrated by
a printf formatting bug closed 'won't fix', although the bug was clearly at odds
with the relevant C standards), and 2) ignores the fact that the .h files in
msvcr90/100 are not the correct headers for msvcrt.dll.

"You may only use the provided files at your own risk" is a very good statement,
and expecting the user to obtain such a complex toolchain is a bad place to start
for contrib/.  The msvcrt.dll bound binaries are built with the appropriate, much
older compiler and headers.  If a user wants to follow your suggested approach,
then editing a few lines of the vcproj file is the least of their worries :)

I respect your enthusiasm, perhaps it makes the most sense to distribute a tool
which allows the user to modify their .vcproj files into this schema, en masse?





More information about the Zlib-devel mailing list