OpenCV Visual Studio 2010 - RC6034 Error (DLL Hell?)
[ Add HTTP:// to the beginning of picture links to make them work for you. ] [ All Steps here were done with both Release and Debug versions. The pictures shown only display debug-related information. ]
OpenCV 2.1.0 does not work properly with Visual Studio 2010 on my computer when it begins to load _Video files with the opencv_ffmpeg Dynamic Link Library_. A number of problems have arisen, specifically with my attempts to get the libraries and such to link for my use in applications. 99% of the errors I've encountered I've solved, save one:
i52.tinypic.com/2yxhmrq.jpg
Error Text:
R6034An Application has made an attempt to load the C runtime library without using a manifest. This is an unsupported way to load Visual C++ DLLs. You need to modify your application to build with a manifest. For more information, please see the "Visual C++ Libraries a SHared Side-by-Side Assemblies" topic in the production documentation.
(Press Retry to debug the application)
Abort | Retry | Ignore
The error spawns from this source code:
#include <c开发者_如何学Gov.h>
#include <cxcore.h>
#include <highgui.h>
int main(int argc, char* argv[]) {
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateFileCapture( "Missile.avi" );
IplImage* frame;
while (1) {
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Example2", frame );
char c = cvWaitKey(33);
if( c == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
}
Missile.avi is in the application's directory (using the full path still generates the same error, so it's not a File-Not-Found error).
Here's a checklist of everything I've done so far:
Attempt to follow the guides put in place by the OpenCV Wiki (opencv.willowgarage.com/wiki/VisualC%2B%2B_VS2010). Using the pre-built install binaries for VS2008 did -not- work for me.
After much googling and reading online, I saw that people obtained success by compiling the libraries themselves after doing a MAKE operation from the source code using CMake. So, I compiled the OpenCV 2.1.0 from scratch using CMake 2.8.2 (gui) to Generate the Visual Studio 2010 OpenCV Solution. It was generated with the Cmake Option specified: BUILD_AS_SHARED_LIBS [YES]. The Solution was able to build in VS2010 with 0 fails on any of the projects.
Put all the appropriate files into the VC++ Directories under the new Visual Studio 2010 property sheet: i53.tinypic.com/2mxlrpg.jpg i54.tinypic.com/2rcbl9j.jpg
Preserve the required Visual Studio ".pdb" files required for Debugging. This was one of the initial errors when I simply used the Installed Binaries from the OpenCV Wiki - I needed to have .PDB files in order to use the "Debug" mode. i56.tinypic.com/oh2tco.jpg
5a. Completing Number 4 allowed me to use the following OpenCV-based code without any issues:
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("funny-pictures-cat-goes-pew.jpg");
cvNamedWindow("Image:",1);
cvShowImage("Image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
5b. The current problem arose when I began compiling code that required use of video files - MOV, AVI, MP4, etc (see code block at top of question). Due to linking the Source Code in the VC++ Directories properties, source code in cvwrap32.cpp that made use of the LoadLibrary function seemed to cause the error: i51.tinypic.com/69kgg7.jpg
The error stated that the loaded library did not have a Manifest (if my reading of the error shown in the picture up top was correct). So, I made sure that every library, when originally generated with CMake 2.8.2 (gui) and compiled in VS2010 had an ".manifest" file. Sure enough, each library had an (LibName).embed.manifest and a (LibName)manifest.rc. I even moved them into the application directory where the current application's .PDB, Manifest, and .ILK files were. The error still stated that the Library I was loading did not have a manifest.
As a last paranoia effort, I went through every project in the OpenCV VS2010 Solution to make sure /YES was on for Manifest Generation. It was.
Ran a depends.exe Dependency test. All required DLLs are present (all the msvcr90.dlls, etc).
That's as far as I got, before everything went to hell. I can't seem to correct this error, because the opencv_ffmpeg210.dll which LoadLibrary is calling from cvwrap32.cpp apparently does not have Manifest Data within it.
Anyone have any ideas?
Computer Specs: Windows 7 Ultimate x86 (32-bit). Compiling with Visual Studio 2010 with Visual C++.
After seeing your post, I knew that I wasn't going crazy. I had almost the exact same issue when running .avi files through the EHCI head tracker (Google summer of code project). I was able to track live video fine, but running the code on movie files generated the R6403 error. In some cases, I could bypass the error and the code was working (similar to the 'one frame' shown case). I had built my OpenCV from the source, which had taken me from not being able to run the hello-world to being able to run that and the EHCI sample code. I kept searching and eventually found this person's opencv_ffmpeg210d.dll file : http://code.google.com/p/opencvthesis/source/browse/trunk/Capture_Estimator/Capture_Estimator/opencv_ffmpeg210d.dll?r=14
I replaced the dll generated by Cmake/VisStudio 2010 (not sure, not really an expert on coding at this level). Voila! Now EHCI works with video files without the R6403 error message.
Thought I should pass along the solution. Maybe you guys can figure out what was wrong in the first place.
I suggest you run through OpenCV-2.1.0 Visual C++ 2010 on Windows 7 to make sure it works. It does not seem like you should have to build the OpenCV binaries yourself?
精彩评论