2

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

This is the error I got, on this line:

videoCapture = highgui.CvCreateCameraCapture(0);

The project shows no warnings or compilation errors so what can be the problem?

1 Answer 1

4

What this almost certainly means is that your application is being compiled as 64-bit, whereas the code in OpenCV is 32-bit, or vice-versa.

In Visual Sudio:

  1. Right click on your project in Solution Explorer and choose "Properties"
  2. Choose the "Build" tab in the project properties that open
  3. Look at the "Platform Target" option about a quarter of the way down
  4. Set it to x86 if it's currently set to x64 or Any CPU

Now try re-running your application, the error should no longer occur.

Note: The download page for OpenCV states that "It does not contain 64-bit binaries"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.