Usr/bin/ld cannot find -lopencv_contrib

I use opencv 4.5.1.
When I tried to compile caffe , it show the error “usr/bin/ld cannot find -lopencv_contrib”.
I was wondering whether the opencv_contrib 4.5.1 has
Do I have to use opencv2.x or opencv3.x?


there is no “opencv_contrib” library. the contrib repository contains several modules, each becomes a library, same as the modules in the main repository.

who instructed you to pass this identifier to the linker?

1 Like

Thanks for your reply ,sir
I was trying to build the caffe which was used to train openpose model .
When it built the caffe module , it show this error.

well there was an opencv_contrib library in opencv2.4,
also the caffe github is full of complaints about using outdated opencv versions there.
but i have doubts, if this is actually used, maybe you can get away with simply removing it from the linker cmdline

Thanks for your help.
I’ll try it again by using the opencv2.4 because I have to train the model of openpose .
I must solve this error.