Including MSVRC100.dll in C++ exe
I created a simple C executable in Visual C++ 2010, but when others tried it the开发者_JAVA技巧y got a missing MSVCR100.dll
error. Apparently, the user needs to install the Visual C++ Redistributable Package in order to run the exe. Is there any way I can instead include MSVCR100.dll inside the exe (so it's just one file, not sitting in the same folder) so people can just run the executable and have it work? Thanks for your help.
Edit: Or at least maybe a way to run the Visual C++ Redistributable Package installer from my exe if it needs to be run?
The easiest way to do what you're looking for is to statically link the C run time - then there's no dependency on the DLL - it's baked into the .exe.
You want to go into the project property's "Configuration Properties/C-C++/Code Generation" tab and change the "Runtime Library" section to "Multi-threaded (/MT)"
精彩评论