Program built with MVS2012 "missing MSVCR120D.dll"

-1

0

I started programming on Visual Studio Express 2012 instead of Code::Blocks, which is way more beautiful, but now I have a HUGE problem: My goal is to release a free OpenSource project with plenty of educational/funny programs that can be DOWNLOADED from others, but when they do so, it says that "MSVCR120D.dll" is missing, so they can't open anything! The exact same project has been compiled on Code::Blocks and everything worked perfectly, but now with Visual Studio nothing works!

So here's my question: How can I SIMPLY compile my code (only one .c or .cpp file) so that others can run it without any problems?

lolgab123

Posted 2015-04-03T00:08:38.210

Reputation: 13

Why can't they ust download the VC++ Redistributable from Microsoft? – Ramhound – 2015-04-03T00:11:32.017

The programs I wrote are really for large and normal public that may not have a lot of computer knowledge, and some people just don't want to install anything... Is there a way, like pretty all the current existant softwares, to compile my code so nothing is needed to be installed? – lolgab123 – 2015-04-03T00:23:53.003

That's the question: How do you do that? My programs only use basic libraries and headers such as <stdlib> or <string>... See at https://docs.google.com/file/d/0B2DQgwgiU8LZOWlYSEpodDRsWjA/edit

– lolgab123 – 2015-04-03T00:48:29.273

Answers

2

If it’s missing MSVCR*D.dll, it’s a debug build. The debug runtime is not part of the redistributable package. Just build a release version.

Oh and by the way: The number 120 indicates Visual C++ 2013, not 2012.

Daniel B

Posted 2015-04-03T00:08:38.210

Reputation: 40 502

omg, I wasn't wven knowing this option... I'm really sorry, but thanks! I will check on that soon and tells you if it worked – lolgab123 – 2015-04-03T01:03:53.853

Oh, maybe... It's the version 12.0, so because 2010 was 10.0, I was thinking that 12.0 was 2012. Does it changes something? – lolgab123 – 2015-04-03T01:12:52.200

No. It just means that you’re using a more up-to-date VC++ version. It’s relevant when deciding which redistributable package to install. – Daniel B – 2015-04-03T01:15:48.143

1

You can build your application with the static runtime using the /MT compile flag. This will eliminate the requirement of having the runtime installed when running the compiled binary.

More information about compiler flags: https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx

ilian

Posted 2015-04-03T00:08:38.210

Reputation: 25

Thanks, will check on that if first solution (switching to release mode) doesn't work – lolgab123 – 2015-04-03T01:04:58.487

@lolgab123 You can always do both, this way users won’t have to install the Visual C++ Redistributable package. – Daniel B – 2015-04-03T01:05:40.280

Ok, thanks! I will definitly check that tonight! I will checked this answer too if I was able too ;) – lolgab123 – 2015-04-03T01:07:52.547

mmmhhhh... Thanks to the link, it seems that the appropriate case is using MD not /MT... And how do you use it? Is it simply /MD[_MD] somewhere in the first lines of code? – lolgab123 – 2015-04-03T01:15:51.630

@lolgab123 You can set the compiler options in the IDE: https://msdn.microsoft.com/en-us/library/3600tzxa.aspx For more info about the difference between /MT and /MD, please take a look at http://stackoverflow.com/a/6799647

– ilian – 2015-04-03T01:20:44.387