0

I compiled my C++ program in Microsoft Visual Studio2015.

The exe file from the Debug folder ran fine on a couple of computers, but on a particular computer it won't run presumably because it only has Microsoft Visual C++ 2008 Redistributable and no later versions.

I'm not allowed to patch the computer since it's running on a Windows thin client.

How do I recompile my code but in VS2008 so that it can run on every computer?

qnxyy
  • 21
  • 4
  • Can you not add required library on that computer? – BiagioF Sep 26 '16 at 22:54
  • Perhaps download a trial: http://stackoverflow.com/a/26742363/12711 Or VS2008 Express: https://go.microsoft.com/fwlink/?LinkId=104679 – Michael Burr Sep 26 '16 at 22:59
  • I'm not sure what are required libraries. I'm still new to programming. Do you mean the #include at the top of my code? – qnxyy Sep 26 '16 at 23:02
  • The thing client got an error of missing MSVCP90D.dll if that helps. And I'm currently installing VS2008 – qnxyy Sep 26 '16 at 23:03
  • Almost dupes: http://stackoverflow.com/q/24172319/560648 http://stackoverflow.com/q/34905488/560648 – Lightness Races in Orbit Sep 26 '16 at 23:03
  • @qnxyy "MSVCP90D.dll" is the required library that Biagio is talking about. There may be more (it will tell you when you try to run with MSVCP90D.dll). – Keith M Sep 26 '16 at 23:08
  • 1
    Off topic: You probably don't want to distribute the debug build to clients. They almost never have the debug libraries and even if they did, they'll probably be happier with a nice and optimized release build. – user4581301 Sep 26 '16 at 23:09
  • "How do I recompile my code"? Do a release build. – 1201ProgramAlarm Sep 26 '16 at 23:13
  • So if I download this MSVCP90D.dll, where do I place it? And how do I do a release build? I've always wrote and tested my code through visual studio and then browse the Debug for .exe. I don't know how else to get a .exe file otherwise. – qnxyy Sep 26 '16 at 23:21
  • I think the file that is missing is vcredist*.exe or msvcr*.dll on the target computer. – sergiol Sep 26 '16 at 23:27
  • I'd recommend against that. For one thing, how much do you trust the source of the DLL? Lots of fun and profit to be had suckering people into installing evil onto people's computers. And it's much easier if you can get other people to do it for you. Another reason is what if this much newer DLL uses functionality that doesn't exist on the older system? Crash city, man. – user4581301 Sep 26 '16 at 23:27
  • 2
    You are not supposed to distribute the debug runtime; installing it on a client machine is not supported. Rebuild the application in the Release configuration so it will use the supported runtime, which may well already be deployed to the workstation. – Michael Burr Sep 26 '16 at 23:28
  • Ah, I've been so blind. I just found the toolbar to change from Debug to Release! – qnxyy Sep 27 '16 at 00:00
  • The program works after I used the release version! Thanks for that. Problem now is that I've kinda broke my VS2015 ever since I installed VS2008... Sigh – qnxyy Sep 27 '16 at 10:20

0 Answers0