문제

Do we still need to bother with vcredist.exe when distributing windows native applications ? Does any of these come bundled with Win-7 ?

If not, are there any technical reasons these are not shipped to people via e.g. windows update - insteadof letting us burden the customers with yet-another-thing-that.must-work ? (Ok, that might sound argumentative, but I'm really wondering the reason these libraries are not default installed/updated on windows machines)

도움이 되었습니까?

해결책

I think it depends how / what you're linked to. If you're linked directly to kernel32.dll etc then it doesn't matter, of course (i.e. the c runtime library is embedded), but Microsoft don't recommend that method of distribution.

If you're linked through msvcr80/90/whatever 2010 is.dll, then you may need to distribute that runtime library as on XP it doesn't come as standard. msvcr80 comes on Vista but msvcr90 doesn't I don't think - although it might get added by windows update. Still, you can't rely on it being there therefore the failsafe is to have a copy of it just in case.

As far as I know msvcrt.dll (that mingw links to) is distributed with everything > xp. Does vc6 link to this? I didn't have VC++ back then.

Take a look at the executable with depends.exe from the Windows SDK and work out what it comes with above and beyond parts of the Windows API.

다른 팁

Yes, you do. Otherwise your program will crash spectacularly when you try to run it. Lots of users aren't running Win7, and even then there's no way to ensure they have the runtime installed without including it in your installer.

Alternately, you could link with the static build of the runtime, avoiding the need of bothering with the C runtime redistributable.

When compiling with GCC I always link with MSVCRT.DLL which is always there on XP and newer.

This is in response to Larry Osterman's comment dated Apr 14 at 23:29:

You say:

msvcrt.dll is not the C runtime. It is an internal component of Windows that should never be used by 3rd party applications. You'll note that you can't find any references on MSDN that use this DLL. Once upon a time 3rd party applications used this but that hasn't been the case for about 10 years. – Larry Osterman Apr 14 at 23:29

This seemed to go against the entire premise of the mingw system which is based on accessing msvcrt.dll and your comment allowed me to better understand how mingw works. It turns out that mingw still uses the msvcrt.dll that was shipped back in 1998! See this link:

http://www.mingw.org/wiki/C99

Thank you,

Todd

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top