Ask Your Question

Linker error with OpenCV legacy and contrib

asked 2019-06-14 17:26:05 -0500

I'm using CDT Eclipse IDE to build a openCV program. And this is the build output. Wthe hat can I try next to avoid the ld errors?

`make all Building file: ../YellowCircleDetect.cpp Invoking: GCC C++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"YellowCircleDetect.d" -MT"YellowCircleDetect.o" -o "YellowCircleDetect.o" "../YellowCircleDetect.cpp" Finished building: ../YellowCircleDetect.cpp

Building target: YellowcircleDetect Invoking: GCC C++ Linkerk g++ -L/usr/local/lib -o "YellowcircleDetect" ./YellowCircleDetect.o -lopencv_core -lopencv_legacy -lopencv_contrib -lopencv_imgproc -lopencv_highgui -lopencv_objdetect /usr/bin/x86_64-linux-gnu-ld: cannot find -lopencv_legacy /usr/bin/x86_64-linux-gnu-ld: cannot find -lopencv_contrib`

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-06-14 23:37:57 -0500

berak gravatar image

it seems, you looked at outdated opencv2.4 build instructions-

there is no opencv_legacy or opencv_contrib module in current opencv

but quite likely, you have to additionally link opencv_imgcodecs and opencv_videoio

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-06-14 17:26:05 -0500

Seen: 30 times

Last updated: Jun 14