I am trying to make a debian package from a Qt application relying on OpenCV.

What I did so far:

  1. I set up an Ubuntu in a Virtualbox
  2. I installed the neccessary software to compile and run the application (Qt related things, ffmpeg, codecs, OpenCV etc.)
  3. I successfully compiled and ran the application
  4. I created a GPG key
  5. With dh_make I created the debian directory in my project dir
  6. I added the packages to debian/control->Build Depends what I got by executing dpkg-depcheck -d qmake
  7. I added to the Depends also what I got by dpkg-depcheck -d SampleApp
  8. I edited the copyright and changelog files
  9. I tried to run dpkg-buildpackage -b

At this point I got the error message:

dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libopencv_imgcodecs.so.3.1 (used by debian/sampleapp/opt/SampleApp/bin/SampleApp)

dh_shlibdeps: dpkg-shlibdeps -Tdebian/sampleapp.substvars debian/sampleapp/opt/SampleApp/bin/SampleApp returned exit code 2

make: *** [binary] Error 2

dpkg-buildpackage: error: debian/rules binary gave error exit status 2

All these files can be found under /usr/local/lib/. I have read this: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html but I could not find the solution. How could I add these dependencies to the package?


Build-Depends field:

Build-Depends: debhelper (>= 8.0.0), libpopt0:i386, libqt5core5a:i386, qtdeclarative5-dev, libglib2.0-0:i386, qtchooser, pkg-config, qt5-qmake:i386, locales

Depends field:

Depends: ${shlibs:Depends}, ${misc:Depends}, udev, libxext6:i386, libxcomposite1:i386, libopencore-amrwb0:i386, libglib2.0-0:i386, libpangocairo-1.0-0:i386, libva-drm1:i386, libxinerama1:i386, libmp3lame0:i386, libnih1:i386, libx11-6:i386, libxcb-render0:i386, libffi6:i386, libgdk-pixbuf2.0-0:i386, libdrm2:i386, libvorbis0a:i386, libfontconfig1:i386, libxrender1:i386, libpango-1.0-0:i386, libdbus-1-3:i386, libpixman-1-0:i386, libopenexr6:i386, libxvidcore4:i386, libjpeg-turbo8:i386, libcgmanager0:i386, libcairo2:i386, libjasper1:i386, libxfixes3:i386, libilmbase6:i386, libtiff5:i386, libusb-1.0-0:i386, libdc1394-22:i386, libxi6:i386, libfreetype6:i386, libxrandr2:i386, libqt5network5:i386, libpng12-0:i386, libthai0:i386, libxcb-shm0:i386, libva1:i386, libvorbisenc2:i386, libtheora0:i386, libharfbuzz0b:i386, libicu52:i386, libjbig0:i386, libopencore-amrnb0:i386, libogg0:i386, libxcursor1:i386, libxcb1:i386, libraw1394-11:i386, libudev1:i386, libnih-dbus1:i386, libqt5core5a:i386, libgraphite2-3:i386, libva-x11-1:i386, libatk1.0-0:i386, libexpat1:i386, libgtk2.0-0:i386, libpangoft2-1.0-0:i386, libdatrie1:i386, libxdmcp6:i386, libvdpau1:i386, libxdamage1:i386, libxau6:i386

If the shared library you depend upon is installed in /usr/local/lib rather than /usr/lib (or similar) then I suspect it's not part of any package managed by the dpkg package manager. dh_shlibdeps wants to build a complete list of all of the things that your new package will have to depend on, but in this case one of those things seems to exist outside of any package so it can't be listed.

You should install OpenCV from a Debian package (plus its corresponding -dev package, so you can build against it), not from a local installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.