18

I have designed an application that requires no install and can be used by non-administrators. I would rather not lose this functionality but when I use the .exe on other computers than the one I programmed it on I get an error that a missing MSVCP100.dll is preventing the file from executing.

What am I doing wrong here? How do I include the file in my release build?

Thanks!

4 Answers 4

30

Configure your project to statically link to the C/C++ runtime instead of linking to the runtime DLL:

  • Configuration Properties | C/C++ | Code Generation | Runtime Library

Select Multi-threaded (/MT) (or Multi-threaded Debug (/MTd) for your debug build).

As an alternative, you should be able to get xcopy deployment of the C/C++ runtime DLL using the technique documented on http://msdn.microsoft.com/en-us/library/ms235291.aspx under the heading "Deploying Visual C++ library DLLs as private assemblies". I haven't tried that technique, as it's generally simpler to just statically link if you need xcopy installation of a native C++ program.

4
  • Ideally, though, you'd use a manifest and distribute via ClickOnce so that future patches to the .dlls you use would get update appropriately. But this also works :)
    – MSN
    Jul 1, 2010 at 23:23
  • @MSN: though that kindof goes against the "requires no install" part ;)
    – Cogwheel
    Jul 1, 2010 at 23:24
  • Not to mention the "c++" part. Jul 1, 2010 at 23:34
  • Thank you so much for your answer. I spent a TON of time trying to figure out how to get my executable to run on another computer without any success until reading your solution.
    – Nate
    Oct 27, 2013 at 22:03
4

http://msdn.microsoft.com/en-us/library/ms235299.aspx

Distributing apps that have been compiled with Visual C++ requires distributing the C++ runtime .dlls that your app uses. In your case, I assume you want to just distribute a folder, so follow the directions (appropriately modified for your app) here:

http://msdn.microsoft.com/en-us/library/dd293565.aspx

Or just copy msvcp100.dll into your application's directory alongside the .exe and you'll be good to go.

32-bit msvcp100.dll is in C:\Windows\SysWOW64\

64-bit msvcp100.dll is in C:\Windows\System32\

1
  • "Or just copy msvcp100.dll into your application's directory alongside the .exe and you'll be good to go." my understanding was you were not allowed to do this? Aug 18, 2011 at 10:50
3

What am I doing wrong here

What you had was dll hell. You had unintentionally used a dynamic linkage with the previous compiler where it just happened on most target systems there was an appropriate C runtime. Windows often included VC 6 CRT, and with more recent SP even VC7 & 8 CRT.

When you changed to the latest VC compiler most systems will not have the new VC runtime pre installed for you.

As Michael Burr says, you can have your 'no install' back if you link statically.

Or you could include the CRT and manifest in the same folder, still doesn't require install.

Or include the vcredist.exe from VS2010 and have a 1 off install

1
  • 2
    Wouldn't this be called "no-idea-what-dll-hell?" Jul 1, 2010 at 23:36
1

You need to install Microsoft Visual C++ 2010 Redistributable Package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.