Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Compilation problem: undefined reference to `cv*

General
2012-12-08
2012-12-12
  • I downloaded the las source from the git to try con compile it.
    I'm using Ubuntu 12.04 64bit.

    The first time I tried to comile I get this error:

    visionpipeline.cpp:320:53: error: ‘cvCalcOpticalFlowHS’ was >not declared in this scope
    make: *** [eviacam-visionpipeline.o] Error 1

    After looking in internet I added this lines to visionpipeline.cpp solve it:
    #include <cv.h>
    #include <cvaux.h>

    After that I tried to compile again and I get this error:

    eviacam-visionpipeline.o: In function CVisionPipeline::CVisionPipeline(wxThreadKind)': visionpipeline.cpp:(.text+0xef0): undefined reference tocvLoad'
    visionpipeline.cpp:(.text+0xf15): undefined reference to cvCreateMemStorage' eviacam-visionpipeline.o: In functionCVisionPipeline::ComputeFaceTrackArea(CIplImage&)':
    visionpipeline.cpp:(.text+0x13e8): undefined reference to cvHaarDetectObjects' visionpipeline.cpp:(.text+0x1401): undefined reference tocvGetSeqElem'
    visionpipeline.cpp:(.text+0x1517): undefined reference to cvClearMemStorage' eviacam-visionpipeline.o: In functionCVisionPipeline::Entry()':
    visionpipeline.cpp:(.text+0x15f2): undefined reference to cvCopy' eviacam-visionpipeline.o: In functionCVisionPipeline::TrackMotion(CIplImage&, float&, float&)':
    visionpipeline.cpp:(.text+0x1a1e): undefined reference to cvCalcOpticalFlowHS' ../creavision/.libs/libcreavision.a(crvcamera.o): In functionCCamera::PostQueryFrame(_IplImage)':
    crvcamera.cpp:(.text+0x1c6): undefined reference to cvFlip' crvcamera.cpp:(.text+0x1fb): undefined reference tocvFlip'
    crvcamera.cpp:(.text+0x1b1): undefined reference to cvFlip' ../creavision/.libs/libcreavision.a(crvimage.o): In functionCIplImage::Free()':
    crvimage.cpp:(.text+0xc2): undefined reference to cvReleaseImage' ../creavision/.libs/libcreavision.a(crvimage.o): In functionCIplImage::Create(int, int, unsigned int, char const
    , int, int)':
    crvimage.cpp:(.text+0x226): undefined reference to cvCreateImageHeader' crvimage.cpp:(.text+0x282): undefined reference tocvCreateData'
    crvimage.cpp:(.text+0x287): undefined reference to cvGetErrStatus' crvimage.cpp:(.text+0x2a3): undefined reference tocvReleaseImageHeader'
    ../creavision/.libs/libcreavision.a(crvimage.o): In function CIplImage::Load(char*)': crvimage.cpp:(.text+0x6d2): undefined reference tocvLoadImage'
    ../creavision/.libs/libcreavision.a(crvimage.o): In function CIplImage::Save(char*)': crvimage.cpp:(.text+0x700): undefined reference tocvSaveImage'
    ../creavision/.libs/libcreavision.a(crvimage.o): In function CIplImage::Show(char*)': crvimage.cpp:(.text+0x72d): undefined reference tocvNamedWindow'
    ../creavision/.libs/libcreavision.a(crvimage.o): In function CIplImage::Reset()': crvimage.cpp:(.text+0x569): undefined reference tocvSetZero'
    ../creavision/.libs/libcreavision.a(crvimage.o): In function CIplImage::Show(char*)': crvimage.cpp:(.text+0x747): undefined reference tocvShowImage'
    ../wxcamwindow/.libs/libwxcamwindow.a(camwindow.o): In function CCamWindow::OnPaint(wxPaintEvent&)': camwindow.cpp:(.text+0x9c6): undefined reference tocvResize'
    camwindow.cpp:(.text+0xa47): undefined reference to cvGetRawData' ../wxcamwindow/.libs/libwxcamwindow.a(camwindow.o): In functionCCamWindow::DrawCam(_IplImage)':
    camwindow.cpp:(.text+0xcc9): undefined reference to cvCopy' camwindow.cpp:(.text+0xd99): undefined reference tocvConvertImage'
    ../wxcamwindow/.libs/libwxcamwindow.a(visiblenormroi.o): In function CVisibleNormROI::OnPaint0(CvSize const&, CIplImage*)': visiblenormroi.cpp:(.text+0x1015): undefined reference tocvRectangle'
    visiblenormroi.cpp:(.text+0x10a5): undefined reference to cvRectangle' visiblenormroi.cpp:(.text+0x1134): undefined reference tocvRectangle'
    visiblenormroi.cpp:(.text+0x11f5): undefined reference to cvLine' visiblenormroi.cpp:(.text+0x1281): undefined reference tocvCircle'
    collect2: ld returned 1 exit status
    make:
    ** [eviacam] Error 1

    I don't know how to solve it. I have compiled other OpenCv software in cpp without any problem.

    Can anybody help me?

     

    Related

    Code: eviacam


    Last edit: Sergio Merino Alonso 2012-12-08
  • Hola Sergio,

    I cloned a fresh copy of eviacam sources on an up-to-date Ubuntu 12.04 64bit and I managed to compile them by issuing:

    ./autogen.sg && ./configure && make

    I guess that some libopencv-* package is missing in your system. On my system, header for function cvCalcOpticalFlowHS is in /usr/include/opencv2/video/tracking.hpp (package libopencv-video-dev)

    Suerte!

     
  • Thank you. I finally compiled it in another computer. I don't know which could be the problem.