0

not sure how to proceed... still wet behind the ears, looking for advice.

//"strange" error using eclipse and opencv while following along in API

./src/captureCV.o: undefined reference to symbol '_ZN2cv12GaussianBlurERKNS_11_InputArrayERKNS_12_OutputArrayENS_5Size_IiEEddi'

and here's the cpp:

/*
 * captureCV.cpp 
 */

#include "opencv2/opencv.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/ml/ml.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"
#include <string.h>
#include <stdio.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;
    }
    return 0;
}

not much to see just sample API material taken from openCV

build exits after executable is made.

Morgan
  • 1
  • 2
  • possible duplicate of [Problems importing libraries to my c++ project, how to fix this?](http://stackoverflow.com/questions/24715864/problems-importing-libraries-to-my-c-project-how-to-fix-this) – πάντα ῥεῖ Aug 20 '14 at 07:00
  • No, I don't believe this to be the issue I am able to use this project directory with a different cpp without issues... the same #includes are at the top as well. I believe it may have something to do with the gaussian blur function; as the error points out... – Morgan Aug 20 '14 at 07:12
  • void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT ); – Morgan Aug 20 '14 at 07:14
  • Do you have the library path and the libraries specified? – πάντα ῥεῖ Aug 20 '14 at 07:15
  • Yes. I have them specified in the project properties. – Morgan Aug 20 '14 at 07:18
  • What is the compilation command for this source file? I compiled it without problems with `g++ captureCV.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui` – morynicz Aug 20 '14 at 12:44
  • I'm using eclipse the default compilation command is just g++ – Morgan Aug 23 '14 at 00:25

0 Answers0