1

Ok so I made a small multithreded program in c++, when I compile it on one machine it works fine but when I try to run it on another machine it says "missing msvcp123D.dll". I went looking around the forums and found some good info on this one. The solution was to create static links to the needed libs. Project Properties -> General -> Use MFC in a Static lib Project Properties -> Input -> additional dependencies -> ? now I would like to ask what libs do I need to add here in order to make this work on Windows 7 , 8, 8.1 machines

Thank you all for your time.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Just make it self-contained: http://stackoverflow.com/questions/5214403/how-to-make-a-single-executable-vs-2010 – Deduplicator Jun 06 '14 at 00:38
  • When you build in debug there are files that won't be on a computer w/o VS installed. – ChiefTwoPencils Jun 06 '14 at 00:40
  • If you linked *everything* static (debug or release) there will be no additional lib requirements. Provided you're not using metro-specific features, your fully-static-linked imagine should run stand-alone without issue on *either* of those OS. @paulm has identified the original problem, btw. That answer is worth the look. – WhozCraig Jun 06 '14 at 00:40
  • Deduplicator I followed that link and it lead me to the problems stated above. – user3259131 Jun 06 '14 at 00:44

1 Answers1

4

msvcp123D.dll is the DEBUG runtime. Build a release version and install the VC2013 redists on the target machines to get rid of this error.

Alternatively you can statically link the run time in which case you'll just need your own binaries (even if its a debug build).

Edit: To statically link the runtime right click the vcxproj file and go to properties, then under C/C++ code generation change "Multithreaded Release/Debug DLL" to "Multithreaded Release/Debug". The options with out "dll" in the name are the static versions.

paulm
  • 5,629
  • 7
  • 47
  • 70
  • "Alternatively you can statically link the run time in which case you'll just need your own binaries (even if its a debug build)." – user3259131 Jun 06 '14 at 00:44
  • If you could provide a bit of more detailed instructions I would be grateful as I am not an expert and have been jumping around on the net try to figure this out. – user3259131 Jun 06 '14 at 00:46
  • 1
    Updated, although I'd recommend just installing the VCRedists + release build. You wouldn't want to be giving debug builds out. – paulm Jun 06 '14 at 00:47
  • If anyone encounters the same problem this solution worked for me: – user3259131 Jun 06 '14 at 02:15
  • Edit: To statically link the runtime right click the vcxproj file and go to properties, then under C/C++ code generation change "Multithreaded Release/Debug DLL" to "Multithreaded Release/Debug". The options with out "dll" in the name are the static versions. – user3259131 Jun 06 '14 at 02:57
  • click the green tick to accept the answer, no need to change the title to "{SOLVED}" this helps others to know what the solution is – paulm Jun 06 '14 at 09:48