0
votes

I am trying to build a project via cmake in qtcreator, but am having trouble with the external package dependencies. There have been several packages that it could not find, but I added symlinks to the actual file locations into the directory cmake was looking in, afetr which they worked fine. However, this one library libopencv_viz.so.3.2.0 isn't cooperationg with me. I added the symlink and visually verified that the file/link is in the correct location, but cmake is still telling me that it cannot find the file, and I have no clue how to solve this. As I stated in a prior post, I am still just learning cmake right now, so I have absolutely no clue why it would not be able to find a package that is verifiably in the correct location.

CMake Error at /usr/share/OpenCV/OpenCVModules.cmake:192 (message): The imported target "opencv_viz" references the file

 "/usr/lib/x86_64-linux-gnu/libopencv_viz.so.3.2.0"

but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and contained

    "/usr/share/OpenCV/OpenCVModules.cmake"

but not all the files it references.

enter image description here

1
Check permissions, file types, etc. Your screenshot shows libopencv_video.so.3.2.0 as a link, but libopencv_viz.so.3.2.0 not. - Peter
File permissions are all identical to all the other symlinks that I made. I ran "file" on the links though, and it says they're broken symlinks. What would cause a symlink to break immediately after creation? I used apt to install the lib, which apparently created a hard symlink to libopencv_viz.so.3.2 from libopencv_viz.so, but the file its pointing to is not there. So obviously this is why my symlink of libopencv_viz.3.2.0->libopencv_viz.so is failing. But why the initial broken link immediately after install when I got no errors on the install? - Chris

1 Answers

1
votes

Creating symlinks by hand suggests you have an incomplete installation. Clean up your manual symlinks, and figure out what's wrong with your installation.

It is normal on Linux that the .so.x.y.z with the full numeric version is the runtime library. That is, the file that is required for applications to run. The version number ensures that the application loads the same library that it was built against.

The .so symlink to .so.x.y.z is for the build chain. When the compiler (linker, really) goes to link against libopencv_viz, it will search for libopencv_viz.so, resolve the symlink to versioned file, and link that.

Many distributions (including Ubuntu) separate the runtime libraries from the development components. My guess is that you've installed the package named libopencv-viz3.2, but not the one named libopencv-viz-dev.