shared libraries conflict

asked 2020-04-25 07:21:57 -0500

andrei186 gravatar image

OpenCV.3.4.10 on Ubuntu 18.04

To use findTransformECC I had to install As a result all my other cpp, which worked well with the libraries mentioned below, now compile with warning:

/usr/bin/ld: warning:, needed by /OpenCV-3.4/lib/, may conflict with

   /usr/bin/ld: warning:, needed by /OpenCV-3.4/lib/, may conflict with

Running the compiled file aborts saying:

error loading shared libraries: cannot open shared object file: No such file or directory

In my /OpenCV-3.4/lib/ I have all these .so files in three versions so, so.3.4 and so.3.4.10 but no so.3.2

Can someone explain what is going on and how to fix it?

edit retag flag offensive close merge delete


You'll be better to upgrade to OpenCV 4

supra56 gravatar imagesupra56 ( 2020-04-25 07:32:27 -0500 )edit

More details. Though there is no in my installation/OpenCV-3.4/lib, file search found it in /lib/x86_64-linux-gnu. By the time-stamp it was created exactly after (and probably as a result of) installation of libopencv-video-dev.

gcc -m64 -Xlinker --verbose  2>/dev/null | grep SEARCH | sed 's/SEARCH_DIR("=\?\([^"]\+\)"); */\1\n/g'  | grep -vE '^$'

returned 12 pathes, /lib/x86_64-linux-gnu being the second one.

My compile script in a makefile:

sudo g++ $(SOURCE).cpp -o $(SOURCE) -I /home/a/Downloads/installation/OpenCV-3.4/include -L /home/a/Downloads/installation/OpenCV-3.4/lib -lopencv_core  -lopencv_highgui -lopencv_photo -lopencv_videoio -lopencv_imgproc  -lopencv_calib3d  $(pkg-config opencv --cflags --libs)
andrei186 gravatar imageandrei186 ( 2020-04-25 08:26:47 -0500 )edit

It looks like ld takes all these shared libraries from my installation/OpenCV-3.4/lib. But ignores, and sitting here. It goes to /lib/x86_64-linux-gnu and picks up which conflicts with demanded by

Why this strated happening after installing libopencv-video-dev and how to fix it?

andrei186 gravatar imageandrei186 ( 2020-04-26 11:18:02 -0500 )edit