Sign in to follow this  
c0uchm0nster

MSVC8 bloated exe dependencies?

Recommended Posts

c0uchm0nster    182
I'm almost finished with my first graphical game (pong with sdl). I'm not trying to find out why the exe requires a certain dll to run on windows machines. Unfortunately I don't have the actual name of the dll written down, but it's something along the lines of MSVC80.dll. Most of my computers apparently already have this dll - 2 xp pro machines (including 1 with visual c express on it - the main development machine). Compiled under linux with g++ the game also runs fine on my two linux boxes. However I have an older win2k box that requires this dll, and I'm not quite sure why. The only libraries I'm using in the project are sdl, sdl_image, std::string, std::vector, and cmath (which I'm thinking might be the culprit?). In any case, can someone tell me how to hunt down the purpose of the file and why my program needs it when running/compiled on windows? Thanks

Share this post


Link to post
Share on other sites
joanusdmentia    1060
The file your thinking of is MSVCR80.DLL. MicroSoft Visual C Runtime. *Every* c++ program compiled has a dependency on a core set of libraries which provide functions such as math, i/o, and program initialisation (the stuff that happens before main() is called). Most computers have the runtime DLLs for MSVC7 and earlier which is why you rarely hear about problems with this version of the compiler, and every Linux distribution comes with libc (the Linux equivalent of MSVCR).

There 2 different ways in which you can link to these core libraries, statically and dynamically. When linking dynamically your program's executable will depend on dynamic libraries, ie DLL's (or .so's in linux), this is more efficient space-wise since all the c/c++ programs can all use a single copy of the library. When linking statically, instead of having these runtime dependencies a copy of the runtime library is 'copied' into the executable itself. So while you no longer have these dependencies, your executables will be larger.

If you want to find the required DLL's files, do a search in C:\WINDOWS\SYSTEM32 (or perhaps C:\WINDOWS\WinSxS, the files you'll find here have extra version information, I'm not sure on the correct distribution method for these). It's probably easier for you to link statically though.

Share this post


Link to post
Share on other sites
c0uchm0nster    182
Thanks for the info.

Is the crt a mandatory windows update option - or am I going to have to manually do this for everything I want to distribute for the next 6+ years (until windows 2k and xp are in lower usage than 98 today)?

Share this post


Link to post
Share on other sites
Nairb    766
Also, be sure to compile in Release mode. I've had problems moving Debug mode compilations across machines which do not have Visual Studio installed.

Cheers,
--Brian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this