VS2012 MSVCR120D.dll is missing
Asked Answered
C

1

16

I am trying to set up my project in VS2012 to successfully compile and run an OSG code for debugging. I am also using OSG debug libraries. Compilation and linking end successfully but after I run the binary I get an error saying that MSVCR120D.dll is missing.

I was looking for a solution to this error the whole day and it doesn't make sense to me, because I am using VS2012 that should use MSVCR110D.dll. I also don't have this dll in C:\Windows\System32, there's only MSVCR120.dll and its older versions.

If I try to compile the project in release mode using non-debug osg libraries everything is fine and I can normally run the project without errors.

Referring to this question I was trying to play with MFC and Runtime Library settings but only release libraries work at all.

I need to run it with debug libraries because I want to use Visual Leak Detector that doesn't work with release libraries. This is part of the code I'm using (OSG libs are compiled with the same VS2012).

#include "stdafx.h"
#include <windows.h>

// osg libs
#include <osgViewer/Viewer>

int main(int argc, char **argv) {
  osgViewer::Viewer viewer;
  while (!viewer.done()) {
    viewer.frame();
  }
  return 0;
}

Here are screenshots of the settings of my project that causes the error:

General settings of project C/C++ Code Generation submenu

Clein answered 16/4, 2014 at 15:56 Comment(3)
You are just using the wrong binaries, they were built to be used on VS2013. You'll need the ones that are compatible with VS2012.Cupriferous
Do you mean the OSG libraries? It's weird, because i compiled osg libs by myself with the same VS2012, that I'm using now.Clein
Noet that I have VLD working in Release as well. I don't think it's restricted to only work in Debug mode.Gosney
P
15

At least one of the libraries you are using is compiled using VC12(2013), so either recompile them (you may see which library is compiled on VC12 using Dependency Walker or install the MSVC 2013 redistributables download from here

Puisne answered 16/4, 2014 at 16:6 Comment(7)
MSVC2013 Doesn't add the MSVCR120D.dll, but only the lib without the "D" in its name. I'll try Dependency Walker and we will see... And as I sad to Hans, I am using OSG libraries that I compiled by myself with the same VS2012...Clein
the "D" stands for debug information, so one of the libraries must have been compiled for debugging on VS2013.Puisne
Yea I get it. But its really weird, because I'm compiling such short part of code (added into question), where are only libraries, that I've compiled by myself with the same VS2012. Can I somehow change in cmake/generated project for what version it will create the libraries? After click on the configure button I select the Visual Studio 11, generate project and then I just compile it for debug and release and afterall istall. I thought that this should create project libraries compatible with my version of Visual Studio.Clein
If you used the latest dependency package from OSG, the libraries are compiled on visual studio 2013, so you either need to recompile each library individually or use an older package osgvisual.org/projects/osgvisual/wiki/Downloads#DependenciesPuisne
How could I forget 3rPardy libs... Thats it, I downloaded the right 3rdParty libs for VS2012 and it just works. Thaks alot, you saved me.Clein
@BrunoFerreira: Too bad that solution doesn't help when there is no source code available. Can the debug version of that DLL file be obtained from anywhere (except shady third-party sides)?Pyroligneous
@O.R.Mapper The debug DLLs come only with the respective version of Visual Studio and are not meant to be redistributed (see this) and redistributing these DLLs are against the EULA. TL;DR: Download the Visual Studio(C++) Express for that version.Puisne

© 2022 - 2024 — McMap. All rights reserved.