Can anyone shed any light on this issue and how to resolve it?
|
Yep. I'm surprised you didn't know this. Sounds like you've been coding awhile. Every version of Visual Studio / VC++ since like 2003 or thereabouts comes with its own unique version of the C/C++ runtime. And to keep programs small the default behavior of VC++ is to link against the specific runtime dll that shipped with it, which dll won't be on older OSs. To solve the problem you've got to either link with the /MT linker switch (its under project properties), or distribute the C++ Runtime Redistributables to other computers than your development box. I personally link with /MT always.
At one time - long ago, the situation was easier. There was only one version of msvcrt.dll and it was on every Windows computer. But then MS started this versioning thing and it caused all these difficulties. I personally like to use the older MinGW compilers because they statically link with the older msvcrt lib and work on every operating system. And the exes are much, much smaller.
Here's some links on the issue...
http://stackoverflow.com/questions/1073509/should-i-redistribute-msvcrt-dll-with-my-application
http://www.syndicateofideas.com/posts/fighting-the-msvcrt-dll-hell
http://sourceforge.net/p/mingw-w64/wiki2/The%20case%20against%20msvcrt.dll/
Also, check in your \system32 directory and you'll likely find piles of dlls that start out with the character string...
msvcr......dll
On the particular box I'm sitting at now, which is an old XP laptop with Visual Studio 2008 installed, I believe the numbers are like so...
msvcrt10.dll
But other possibilities depending on which version of Visual Studio is installed would be such numbers as 12, 14, etc. Also, some of the names are such as...
msvcpp10, 12, etc. Chances are good to get the program working to just copy those files from the box that has them to the box that doesn't. Of course, the 'approved' way is to install the redistributable package. Or just compile/link with /MT, as I said before. Or use MinGW.