I encountered a problem with opencv after updating from version 3.x to 4.x. It would seem that factory supplied opencv headers (or any other project header for that matter) are missing other factory supplied opencv headers due to a changed install path of the library.
Previously, all opencv headers were installed in /usr/include/opencv2, but now that was changed to /usr/include/opencv4/opencv2, which causes older include paths not to work any more. If I create a /usr/include/opencv2 symlink to /usr/include/opencv4/opencv2, the problems seem to disappear.
I find this change in install path to be pretty severe and unnecessary, especially considering how much damage it does. All previously working projects stopped building because of it, and now all project files using opencv includes now need updating.
Additionally, renaming the /usr/share/pkgconfig/opencv.pc file to opencv4.pc is equally damaging, as qmake is now incapable of finding the opencv lib, unless all qmake build files are updated to use PKGCONFIG += opencv4 instead of opencv.
These renames and path changes break backwards compatibility, not to mention the fact, that by adding major version numbers to the file and folder names will guarantee such breakages in the future. Considering all this, a change back to the original path and names should be considered to avoid such problems in the future.
Thanks for reading.