问题
I know this question was asked before. But I need a real answer, a real explanation! When running (ctrl+F5) the code shown underneath, in Visual Studio 2012 Express, in Release mode, everything works. When running it in Debug mode, I get:
The program cant't start becaue MSVCP100.dll is missin from your computer...
I already installed the Redistributable Package 2010 and 2012.
What is going on??? Please a detailed Explanation, that I can understand :) Thanks a lot!!!
#include "stdafx.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
Mat image = imread("Bild.jpg");
namedWindow("Mein Bild");
imshow("Mein Bild", image);
waitKey(5000);
//The member variable data is in fact a pointer to the allocated memory block that will contain
//the image data. It is simply set to 0 when no image has been read.
if(!image.data)
{
cout<<"No image has been createt"<<endl;
}
cout<<"height = " << image.size().height <<"\t width = "<< image.size().width<<endl;
//page 27
return 1;
}
回答1:
By design. You are not allowed to redistribute Debug Mode executables. As the name says, they are for debugging, not releasing.
回答2:
Using the compiler options to change the runtime library worked for me ("Configuration Properties"/"C/C++"/"Code Generation". In the item labelled Runtime Library, select Multi Threaded (/MT) for the release version and Multi Threaded Debug (/MTd) for the debug version). I did have to do both the debug and the release to get the release to work. Don't know why.
Note: I was using VC2010 Express version on Windows 7 to compile. I tested on an old XP machine. Another note: MS information at http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.100).aspx
回答3:
I got the same error and also tried all the solutions I could find on the internet for a couple of days but I finally managed to fix it myself.
If you're using Windows 7 try reinstalling your operating system. Since I was using Win 8, I just refreshed my computer and never received the error again. Once you get your code working don't forget to create a restore point just in case :)
Note that if you refresh your computer, you'll have to install all your programs but all your personal files will still be there.
来源:https://stackoverflow.com/questions/18952464/msvcp100d-dll-is-missing-on-your-computer-debug-mode-visual-c-2012