Ask Your Question

Error in making graphs in OpenCV

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

updated 2017-09-15 15:11:11 -0500


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

For this purpose, I added the following files (from 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

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

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


Thank-you @berak

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

Question Tools

1 follower


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

Seen: 813 times

Last updated: May 30 '17