How to resolve library (.so) dependancy ?

asked 2019-03-11 05:07:33 -0500

npatil15 gravatar image

updated 2019-03-11 07:43:31 -0500

Hi,

I'm using opencv3.3.1 for Linux platform in Qt framework. Having tree structure like this below

Compiler: Desktop Qt 5.9.4 MSVC2015 64bit (Microsoft Visual C++ compiler 14.0 (amd64))

.
|---- bin
|---- build
| |---- include
|----include
| |---- opencv
| |---- opencv2
|---- lib
| |---- pkgconfig
| |---- python2.7
|---- share
|---- OpenCV

I have linked all the libraries which is on the path: /lib

libopencv_calib3d.so libopencv_imgcodecs.so.4.0.0 libopencv_stitching.so.4.0 libopencv_calib3d.so.4.0 libopencv_imgproc.so libopencv_stitching.so.4.0.0 libopencv_calib3d.so.4.0.0 libopencv_imgproc.so.4.0 libopencv_superres.so libopencv_core.so libopencv_imgproc.so.4.0.0 libopencv_superres.so.4.0 libopencv_core.so.4.0 libopencv_ml.so libopencv_superres.so.4.0.0 libopencv_core.so.4.0.0 libopencv_ml.so.4.0 libopencv_videoio.so libopencv_features2d.so libopencv_ml.so.4.0.0 libopencv_videoio.so.4.0 libopencv_features2d.so.4.0 libopencv_objdetect.so libopencv_videoio.so.4.0.0 libopencv_features2d.so.4.0.0 libopencv_objdetect.so.4.0 libopencv_video.so libopencv_flann.so libopencv_objdetect.so.4.0.0 libopencv_video.so.4.0 libopencv_flann.so.4.0 libopencv_photo.so libopencv_video.so.4.0.0 libopencv_flann.so.4.0.0 libopencv_photo.so.4.0 libopencv_videostab.so libopencv_highgui.so libopencv_photo.so.4.0.0 libopencv_videostab.so.4.0 libopencv_highgui.so.4.0 libopencv_shape.so libopencv_videostab.so.4.0.0 libopencv_highgui.so.4.0.0 libopencv_shape.so.4.0 pkgconfig libopencv_imgcodecs.so libopencv_shape.so.4.0.0 python2.7 libopencv_imgcodecs.so.4.0 libopencv_stitching.so

For linking I have tried with this below,

unix|win32: LIBS += -L$${PATHOFDIR}/video -lvideo
INCLUDEPATH += $${PATHOFDIR}/video
DEPENDPATH += $${PATHOFDIR}/video

OPENCVLINUXDIR = /home/thirdparty/opencv/opencv_3.3.1

INCLUDEPATH += $${OPENCVLINUXDIR}/include
DEPENDPATH += $${OPENCVLINUXDIR}/include

LIBS += -L$${OPENCVLINUXDIR}/lib -lopencv_core -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio -lopencv_videostab

    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_core.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_calib3d.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_features2d.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_flann.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_highgui.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_imgcodecs.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_imgproc.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_ml.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_ml.so.4.0.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_objdetect.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_photo.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_photo.so.4.0.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_shape.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_stitching.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_superres.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_video.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_videoio.so.4.0
    dependencies.files += $${OPENCVLINUXDIR}/lib/libopencv_videostab.so.4.0

Please help me out why I'm getting this errors

Still 2 libraries I'm unable to link, say (libopencv_core.so.4.0, libopencv_videoio.so.4.0), got this below error,

:-1: warning: libopencv_core.so.4.0, needed by /home/test/UnitTest/../../build/release/modules/video/libvideo.so, not found (try using -rpath or -rpath-link) :-1: warning: libopencv_videoio.so.4.0, needed by ...

(more)
edit retag flag offensive close merge delete

Comments

MSVC2015 64bit

it does not build any .so files, you have to change / revise the linux based receipes for windows

I'm unable to link, say (libopencv_core.so.4.0

no you don't link .so or .dll files in the 1st place

/home/thirdparty/opencv/opencv_3.3.1

what ? please don't try to mix 3.3.1 and 4.0.1

berak gravatar imageberak ( 2019-03-11 05:52:23 -0500 )edit

Here is the scenario: I have one module developed in QT, say Video module, in which I have uses same libraries and in the same order, their it works pretty well (No Errors or warnings). Now I'm doing UnitTest for Video module, and calling method of Video module for test, and done the same configuration in UnitTest as done in Video module (Getting warnings and errors as already explained).

And sorry to mix it but its 4.0 library only.

npatil15 gravatar imagenpatil15 ( 2019-03-11 07:26:24 -0500 )edit

Please follow this link, for more details, https://www.qtcentre.org/threads/7006...

npatil15 gravatar imagenpatil15 ( 2019-03-11 07:27:56 -0500 )edit