-1

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?

  • Why can't they ust download the VC++ Redistributable from Microsoft? – Ramhound Apr 3 '15 at 0:11
  • 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 Apr 3 '15 at 0:23
  • That's the question: How do you do that? My programs only use basic libraries and headers such as <stdlib> or <string>... See at docs.google.com/file/d/0B2DQgwgiU8LZOWlYSEpodDRsWjA/edit – lolgab123 Apr 3 '15 at 0:48
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.

| improve this answer | |
  • 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 Apr 3 '15 at 1:03
  • 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 Apr 3 '15 at 1:12
  • 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 Apr 3 '15 at 1:15
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

| improve this answer | |
  • Thanks, will check on that if first solution (switching to release mode) doesn't work – lolgab123 Apr 3 '15 at 1:04
  • @lolgab123 You can always do both, this way users won’t have to install the Visual C++ Redistributable package. – Daniel B Apr 3 '15 at 1:05
  • Ok, thanks! I will definitly check that tonight! I will checked this answer too if I was able too ;) – lolgab123 Apr 3 '15 at 1:07
  • 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 Apr 3 '15 at 1:15
  • @lolgab123 You can set the compiler options in the IDE: msdn.microsoft.com/en-us/library/3600tzxa.aspx For more info about the difference between /MT and /MD, please take a look at stackoverflow.com/a/6799647 – ilian Apr 3 '15 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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