Please help with compile error

asked 2013-11-26 20:14:07 -0500

updated 2013-11-27 19:19:22 -0500

I get error: main.o undefined reference to symbol '_ZN2cv8cvtColorERKNS_11_InputArrayERKNS_12_OutputArrayEli'

Using ubuntu 13.1

#include "opencv2/opencv.hpp"
//#include <opencv/cv.h>
//#include <opencv/highgui.h>


using namespace cv;

int main(int, char**)
{
    VideoCapture cap(0); // open the default camera
    if(!cap.isOpened())  // check if we succeeded
        return -1;

    Mat edges;
    namedWindow("edges",1);
    for(;;)
    {
        Mat frame;
        cap >> frame; // get a new frame from camera
        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;
    }
    // the camera will be deinitialized automatically in VideoCapture destructor
    return 0;
}
edit retag flag offensive close merge delete

Comments

1

forgot to link against opencv_imgproc ?

berak gravatar imageberak ( 2013-11-27 02:07:56 -0500 )edit