Click here to Skip to main content
15,113,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i run my code this error occurred :

and my code is :

#include "cv.h"
#include "highgui.h"

using namespace cv;

int main(int, char**)
    VideoCapture cap(0);
    if(!cap.isOpened()) return -1;

    Mat frame, edges;
        cap >> frame;
        cvtColor(frame, edges, CV_BGR2GRAY);
        GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
        Canny(edges, edges, 0, 30, 3);
        imshow("edges", edges);
        if(waitKey(30) >= 0) break;
    return 0;

i check opencv bin and dll's but this dll exist
[no name] 28-Mar-13 12:24pm
But the DLL has to be in the path where the system can find it.

1 solution

The Phantom is right, the Dll needs to be where Windows can find it. That means in the same folder as the exe that is loading it or in a folder referenced by the PATH environment variable or one on the default search list like the Windows System32 folder.
For a fullish explanation of where Windows searches and in what order you'll need to Google up the official Microsoft page but I wouldn't bother, it was incomplete/incorrect the last time I looked at it, just put the Dlls and the EXE in the same folder.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900