Ask Your Question
0

undefined reference linker error opencv 3.1.0

asked 2019-12-07 00:54:42 -0600

I am using opencv 3.1.0 with DevC++ 5.11. I am getting the error : undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&, cv::_InputArray const&) const' similarly for a large number of functions. I came to know it is a linker error. How to get rid of it? DO I need to add any commands while calling the linker? I have added the files ffmpeg310.dll and opencv_world310.dll as parameters to the project.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-07 02:16:21 -0600

berak gravatar image

updated 2019-12-07 02:22:42 -0600

DevC++ 5.11

bad choiice, it's outdated and not supported from opencv.

if you want to use this, you will need to build the opencv libs from src, you cannot use those prebuilt libs, which are for visual studio ONLY.

(and, once you decide to build from src, you'd also want to update it to recent 3.4.9, no ?)

I have added the files ffmpeg310.dll and opencv_world310.dll

first, you have to link to .lib or .a or .dll.a files, not to the dll's or so's

you don't need (and should not) link to the ffmpeg dll, but you need this to be on the PATH later

edit flag offensive delete link more

Comments

So which is the best IDE to use with OpenCV with Windows? Is it Eclipse or Microsoft Visual Studio?

anamaykane gravatar imageanamaykane ( 2019-12-07 07:36:19 -0600 )edit
1

i'd say : sublime3 ;)

(compiler is all that matters here, not your editor/ide, and eclipse has the same problem - using mingw)

again, either get VS (and ditch that crap devcpp) or you'll have to build from src, whatever you use.

berak gravatar imageberak ( 2019-12-07 07:38:27 -0600 )edit

Okay thanks for the suggestion. Am trying with Visual Studio.

anamaykane gravatar imageanamaykane ( 2019-12-07 11:38:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-07 00:54:42 -0600

Seen: 691 times

Last updated: Dec 07 '19