Update: Installing OpenCV with Microsoft Visual Studio 2005 C++
I have found I kept getting an error when I modified some of the example code.
The error message was:
C Run-Time Error R6034
Error Message
"An application has made an attempt to load the C runtime library incorrectly. Please contact the application’s support team for more information."
After trying a few of the suggested fixes I was starting to give up hope.
Luckly I found a post suggesting to change the configuration from debug to retail and recompiling.
It worked!

I met the same problems and I can not find the useful post you mentioned.
Comment by Litian — February 14, 2007 @ 2:45 pm
Oh, I got it, just change the configuration. It works, thank you.~~~
Comment by Litian — February 14, 2007 @ 2:51 pm
Hey!
I have same error too, could you so kindly post the solution please
Comment by Zealous — March 2, 2007 @ 6:17 pm
The solution I found was change the configuration from debug to retail and recompile
Comment by Dan — March 3, 2007 @ 9:58 am
Maybe you need to do this additions to VC++ and the path variable:
Check:
http://www.cs.iastate.edu/~alex/classes/2006_Fall_401/labs/lab_04/OpenCV_in_MSVS.txt
Comment by Desert — August 18, 2007 @ 6:02 pm
Thank you for that link.
I will test it once I get a moment.
Comment by Dan — September 27, 2007 @ 12:21 pm
I found a fix. It is to add MSVCRT.dll to the “Ignore specific library” of the application you are building. You might need to add this to highgui too but I’ll bet it will work with just your app.
The problem appears to be that highgui is loading a bunch of other libraries that you don’t have the source for. Some of those libraries use MSVCRT, others use MSVCRTD. So when you try to run, Windows complains because there’s a conflict. I don’t know why this started happening but it makes a certain kind of sense because they’re both supposed to do the same thing. Anyway, keep the non-debug runtime library out of there and you should be OK.
Comment by Jon Webb — September 27, 2007 @ 11:23 pm
Well, I just tested, and it appears that you have to build highgui with MSVCRT.lib and MSVCRT.dll listed in the ignore specific libraries. So do that. You have to separate them with a semicolon.
Comment by Jon Webb — September 27, 2007 @ 11:26 pm
I have a problem, when I try to run my program there is a message “cxcore100.dll was not found” and the cxcore100.dll is on bin library. I can build the solucion without errors, but the problem is when I try to run it. Can somebody help me, please?? Thanks
Comment by Ana — November 1, 2007 @ 10:45 am
Have you built the cxcore src? I’m guessing you have as you say the dll exists in the bin directory.
Are you running the solution from the bin directory?
Comment by Dan — November 3, 2007 @ 11:10 pm
There is no need to copy all the files to the project directory. This error is caused when the OpenCV/lib directory is not added to the PATH variable of your Windows.
The solution is to just add the path of OpenCV/lib directory i.e for example “C:\Program Files\OpenCV\lib” or wherever you OpenCV library is installed , to the PATH variable in the Environment Variables of your windows installation. This can be done by right clicking “My Computer” icon and then Properties and “Advanced System Settings” and Environment Variables and then adding the path of the OpenCV /lib directory to the “PATH” in the System “Variables window”
Comment by Satyadeep — June 6, 2008 @ 11:59 am