Ask Your Question
1

Error in making graphs in OpenCV

asked 2017-05-30 01:06:23 -0600

updated 2017-09-15 15:11:11 -0600

Hi!

I want to generate plots in OpenCV, using the following link:

http://answers.opencv.org/question/73233/how-do-you-plot-graphs-in-opencv-projects/

For this purpose, I added the following files (from https://github.com/opencv/opencv_contrib/tree/master/modules/plot in OpenCV folder as mentioned below.

plot.hpp >> opencv\build\include\opencv2

precomp.hpp >> opencv\build\include\opencv2

plot.cpp >> opencv\sources\modules\plot\src

but after building the code, I receive the following error

Error 2 error LNK1120: 1 unresolved externals

Error 1 error LNK2019: unresolved external symbol "struct cv::Ptr<class cv::plot::plot2d=""> __cdecl cv::plot::createPlot2d(class cv::_InputArray const &)" (?createPlot2d@plot@cv@@YA?AU?$Ptr@VPlot2d@plot@cv@@@2@ABV_InputArray@2@@Z) referenced in function _main

Please help me in resolving this issue.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2017-05-30 06:02:05 -0600

berak gravatar image

it won't work like this. your plot.cpp will never get compiled or linked, thus the errors.

please either install opencv_contrib correctly (please see readme there) OR put the plot.cpp and plot.hpp into your own project . then you'll have to remove the #include "precomp.hpp" line, and maybe fix some missing opencv headers.

edit flag offensive delete link more

Comments

Thank-you @berak

Ayesha Siddique gravatar imageAyesha Siddique ( 2017-05-31 06:06:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-05-30 01:06:23 -0600

Seen: 1,120 times

Last updated: May 30 '17