2

I am trying to integrate OpenCV into an application and facing some issues below.

error while loading shared libraries: libopencv_imgproc.so.4.1: cannot open shared object file: No such file or directory

However, when I check the output of ldd and readelf, below are the differences.

$readelf -d <app name>
0x0000000000000001 (NEEDED)             Shared library: [libopencv_imgcodecs.so.4.1]
0x0000000000000001 (NEEDED)             Shared library: [libopencv_core.so.4.1]

$ldd <app name>
libopencv_imgcodecs.so.4.1 => <path to opencv>/opencv/lib/libopencv_imgcodecs.so.4.1 (0x00007f04555b2000)
libopencv_imgproc.so.4.1 => <path to opencv>/opencv/lib/libopencv_imgproc.so.4.1 (0x00007f0453e8f000)
libopencv_core.so.4.1 => <path to opencv>/opencv/lib/libopencv_core.so.4.1 (0x00007f0452774000)

As shown above, libopencv_imgproc is missing from readelf output. Can someone point out what causes such behavior?

pree
  • 2,297
  • 6
  • 37
  • 55
  • Maybe check this [post](https://stackoverflow.com/questions/480764/linux-error-while-loading-shared-libraries-cannot-open-shared-object-file-no-s) out. Seems relevant to your issue. – alteredinstance Jan 09 '20 at 17:38
  • Not really. I have checked full names and symlinks are already there. – pree Jan 09 '20 at 17:44
  • Ur library directory added to /etc/ld.so.conf.d/opencv.conf ? In my side I also tried readelf and gave me also ".....(NEEDED)." But this didnt create a problem to integrate OpenCV to my app. I think problem is not about readelf. – Yunus Temurlenk Jan 10 '20 at 06:23
  • Just guessing: Is imgproc a dependency introduced by imgcodecs , and ldd follows that, while readelf only lists first level dependencies? – Kjell Aug 05 '22 at 12:55

0 Answers0