Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hello guys

I downloaded and unzipped OpenCV-2.4.2.exe(the latest version) on my PC. Than created a new Win32 project in VS 2012,set all the Paths in Project properties, set the environmental variables in Win7.
All look fine and studio doesn't see any problems.
When I try to start the program in debugging mode I get the "The program can't start because MSVCR100D.dll is misssing from your computer. Try reinstalling the program to fix this problem"

Ok/ I downloaded the MSVCR100D.dll and threw it in Windows/System32 ...But the problem still remains.
As I understand pre-built version of OpenCv is suited for VS 2010 or earlier versions.
What should I do to use Opencv in Vs 2012/ I wouldn't like to build the opencv libraries from scratch. Maybe is there another simpler way ???

If somebody has the pre-buil 2.4.2 for VS 2012 please give a link.

Thanks in advance
Posted

This is a debug version of the library. For the configuration "Release", you need to version of it without 'D'. This is only one of possible problems.

Unfortunately, your problem means that having just the required platform and its executable files is not enough, you will also need to install and re-distribute additional package called "Visual C++ redistributable for Visual Studio 2012". Please see:
http://www.microsoft.com/en-us/download/details.aspx?id=30679[^].

Such redistributable packages exist for all versions of the Visual Studio for every instruction-set architecture, separately.

—SA
 
Share this answer
 
v2
Comments
JOHN 602 30-Sep-12 11:09am    
Oh,Sergey, your suggestion about this extension has really helped me. As I see you are an expert without any doubts.
But I after extension installation, my code works fine only with Release mode. When i switch to Debug, VS again requires this "MSVCR100D.dll". Of course It is possible to work in Release, but I'm sure there is a way to do normally, is it? And thank you for your reply.
Sergey Alexandrovich Kryukov 30-Sep-12 12:12pm    
Please check the OpenCV library itself. What you see might mean that it is itself supplied in different version for different configurations. The library may link to different CRT libraries in different configurations. You can also work around it if you build the library from source by yourself, as in Solution 1.

When and if you see the resolution of your problem, please consider accepting the answer formally (green button); I suggest you also accept Solution 2.
--SA
pasztorpisti 30-Sep-12 12:02pm    
+5, Once I used MFC and CRT dlls with local installation (unfortunately the prog was dependent on 2 CRT versions because of a 3rd party so we copied the runtime dlls to the app directory with some manifest magic). However I don't know if local installation is possible with debug runtime dlls, I have always used the debug runtime that was installed by VS.
Sergey Alexandrovich Kryukov 30-Sep-12 12:13pm    
Thank you. Please see also my comments to OP's comment and to the solution by Espen and my comment to it.
--SA
JOHN 602 30-Sep-12 13:12pm    
Oh.. finally It works how it should do.
Somehow, msvcr100d.dll was lost in System32.(maybe I've made a hash of similar looking msvcP100d.dll)
After I copied it there,the Debug mode works properly.
Thanks guys for your support.
Have a look at: OpenCV Installation Guide[^]

Building it yourself using CMake[^] is pretty straight forward.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
JOHN 602 30-Sep-12 11:28am    
I know about Cmake and I've already made an attempt and got a heap of errors during the compiling process. This way will be the last in my solutions list.
Sergey Alexandrovich Kryukov 30-Sep-12 12:10pm    
Please see also my comment to the answer -- that's the idea how to go about it.
--SA
Sergey Alexandrovich Kryukov 30-Sep-12 12:09pm    
Good idea, my 5. The solution could be having the separate linking to the Visual Studio re-destributed libraries for Release and Debug. If such approach is used in the library, the library itself is supplied for different configuration, but with OP's own build it could be done the way OP wants.

OP has the problem of linking of different CRT libraries for different configurations -- please see my solution and my comment to OP's comment.
--SA
Espen Harlinn 30-Sep-12 17:52pm    
Thank you, Sergey :-D
pasztorpisti 30-Sep-12 12:44pm    
+5 I think cmake + VS is quite a comfortable solution to build a static or dynamic lib for later use in a project. Distributed library binaries always have the plague of having dependency on different versions of the CRT libs.
Currently the libraries for OpenCV with Visual Studio 2012 (vc11) are not provided. So you will have to run your code in release configuration. I've also read a few people using the MSVCR100D.dll from an alternate installation of Visual Studio 2010 or Visual C++ 2010 Express. See if that works for you.
 
Share this answer
 
I have Configured OpenCV 2.4.6 with VS 2012 using this Guide.

OpenCV Configuration Guide

Hope, it would serve the purpose.

Regards.
 
Share this answer
 
As of my experience; it would be better to build OpenCV with VS 2012.
Pre-build OpenCV is normally build using VS 2010 and tries to refer to MSVCP100D.DLL file when executed instead of VS 2012 DLL files.

Regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900