Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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 30-Sep-12 2:12am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2
Comments
JOHN 602 at 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 at 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 at 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 at 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 at 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.
Sergey Alexandrovich Kryukov at 30-Sep-12 13:34pm
   
You are welcome.
Good luck, call again.
--SA
Espen Harlinn at 30-Sep-12 17:53pm
   
5'ed! :-D
Sergey Alexandrovich Kryukov at 30-Sep-12 19:00pm
   
Thank you, Espen.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Have a look at: OpenCV Installation Guide[^]
 
Building it yourself using CMake[^] is pretty straight forward.
 
Best regards
Espen Harlinn
  Permalink  
Comments
JOHN 602 at 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 at 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 at 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 at 30-Sep-12 17:52pm
   
Thank you, Sergey :-D
pasztorpisti at 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.
Sergey Alexandrovich Kryukov at 30-Sep-12 13:35pm
   
Exactly. By the way, OP resolved the problem, accepted both answers (as I recommended to do :-).
Teamwork! :-)
--SA
pasztorpisti at 30-Sep-12 14:37pm
   
All well that ends well. :-)
Espen Harlinn at 30-Sep-12 17:52pm
   
Thank you, pasztorpisti :-D
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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,
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

I have Configured OpenCV 2.4.6 with VS 2012 using this Guide.
 
OpenCV Configuration Guide
 
Hope, it would serve the purpose.
 
Regards.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 368
1 Richard MacCutchan 240
2 OriginalGriff 230
3 Jared Sanow 145
4 Vinay Mistry 133
0 Sergey Alexandrovich Kryukov 5,955
1 OriginalGriff 4,805
2 CPallini 2,473
3 Abhinav S 1,507
4 Richard MacCutchan 1,437


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 13 Nov 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100