Pages

Tuesday, December 15, 2009

OpenCV 2.0a and Visual Studio 2008 Conflict

If you had recently upgraded to Visual Studio C++ 2008 SP1 or whatever upgrade, your OpenCV will fail to run. It will display this error when you try to run the apps

“application failed to initialize because of improper configuration”

To solve this, either go to your Project Properties Page and Under C/C++ Pre-processor Definitions, you enter this command _BIND_TO_CURRENT_VCLIBS_VERSION=1

if ur project is using Precompiled Header, which mean you will see StdAfx,h,  you should include this command in your StdAfx.h instead

#define _BIND_TO_CURRENT_VCLIBS_VERSION 1


This solution is given in msdn http://msdn.microsoft.com/en-us/library/cc664727.aspx



due to the difference in the manifest version.



If all still fail after doing all this, then do a clean uninstall of vc2008, then install again. Then Rebuild your OpenCV and your Project, your project will run fine.

No comments:

Post a Comment