Ask Your Question
0

Undefined reference to 'cvSmooth'

asked 2016-12-01 08:10:54 -0500

petro gravatar image

Hi. Write on QT and use version OpenCV 2.4.13. Today, with a problem. When you start the program, fails with the following error:

D:\delo\po-russian\po-russian\sglazhivanie.cpp:31: error: undefined reference to `cvSmooth'

and

collect2.exe:-1: error: error: ld returned 1 exit status

#include <cv.h>
#include <highgui.h>
#include <stdlib.h>
#include <stdio.h>

IplImage* image2 = 0;
IplImage* dst = 0;

int main(int argc, char *argv[])
{

   const char *filename = argc == 2 ? argv[1] : "C:\deva.jpg";

    image2 = cvLoadImage(filename, 1);


    dst = cvCloneImage(image2);

    std::cout << "[i] image: %s\n" << filename;
    assert( dst != 0 ); 



    cvNamedWindow("original", CV_WINDOW_AUTOSIZE);
    cvNamedWindow("smouth", CV_WINDOW_AUTOSIZE);


    cvSmooth(image2, dst, CV_GAUSSIAN, 3, 3); //THIS ERROR - - - - - - - 


    cvShowImage("original", dst);
    cvShowImage("smouth", image2);

    cvWaitKey(0);


    cvReleaseImage(& image2);
    cvReleaseImage(& dst);


    cvDestroyWindow("original");
    cvDestroyWindow("smouth");

    return 0;
}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-12-01 08:24:41 -0500

berak gravatar image

problem is, that your code is from the arcane opencv1.0 api (years ago...)

please throw it away, and restart with current tutorials

the replacement for cvSmooth() would be GaussanBlur()

edit flag offensive delete link more

Comments

1

Many thanks!

petro gravatar imagepetro ( 2016-12-01 08:27:00 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-12-01 08:10:54 -0500

Seen: 283 times

Last updated: Dec 01 '16