OpenCV 错误

Error In OpenCv

我从教程中安装并配置了opencv,但是当我尝试实现它的代码时,与opencv相关的所有内容都显示为错误,如图所示。你能帮我么?我真的需要它

#include "stdafx.h"
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace std;    
using namespace cv;

int Main( void)
{
    CvCapture* capture = 0;

    // Start Capture From WebCam
    capture = cvCaptureFromCAM( CV_CAP_ANY );
    if( !capture )
    {
        cout << "No camera Detected" << endl;
    }
    // Create New Window
    cvNamedWindow( "My OpenCV WebCam", CV_WINDOW_AUTOSIZE );

    if( capture )
    {
        cout << "WebCam Is In capture" << endl;
        for(;;)
        {
            // Get Captured Image And Show It In The New Window 
            // You Can Do Save It Or Filter It
            IplImage* iplImg = cvQueryFrame( capture );

            // Use This To Filter Image
            //cvNot(iplImg, iplImg);

            cvShowImage( "My OpenCV WebCam", iplImg );

            if( waitKey( 10 ) >= 0 )
                break;
        } 
    } 


    cvReleaseCapture( &capture );
    cvDestroyWindow( "My OpenCV WebCam" );

    return 0;

}

从对问题的评论中可以看出,OP 正在链接到 OpenCV 2.4.8,而不是 OpenCV 3.0.0。

更正链接库名称以及库路径,问题已解决。