Cannot compile some issue with

I am on a linux platform (ubuntu 20.04), and have successfully installed opencv4, however when I try to compile anything I get 1 error that seems to stop everything.

/usr/bin/ld: warning:, needed by /usr/local/lib/, not found (try using -rpath or -rpath-link)

I have, so I created a link to
I have run sudo ldconfig after making this change, but the problem persists. is provided by another package, and the only other version I see in the repos is

my build flags are:
g++ -Wall -g -o “%e” “%f” -I/usr/local/include/opencv4 pkg-config --cflags --libs opencv4

while the reference to is only a warning, the inability to link to it results in many undefined references, that then makes everything fail to build

how can I fix this?

I’m assuming that you installed a binary package but didn’t build OpenCV yourself?

you should take this issue up with the maintainer of the package. look for the package on

maybe someone here can help but don’t count on it.

That is incorrect sir, I have compiled from source, downloaded from the opencv website. What i do have is an old computer, which has run opencv versions in the past. I have had opencv 2, 3, and now 4.

In the last 4 years, I have not done much with opencv, but was looking to get back into it. it would seem much has changed in that time. I was hopeful old programs I wrote would be immediately compatable, such that I could just add some features, and continue. It would seem some of the naming conventions have changed. … In any event,

I have done a clean install using the instructions provided. libjasper was the only package I could not locate, I do not think this is critical. I had build success from the source files. My issue only pertains to when I try to build files in g++.

you could try to go back there, and disable the OPENEXR support for imread() (float point images). then your opencv so’s won’t depend on the faulty lmf libs any more,

if you want to do this, add


to your cmake cmdline, and rebuild / reinstall the libs

1 Like