Hello to everyone,
I know this problem is already discussed, but I can't find a way to solve it.
I built the OpenCV (3.4.15) libraries in dynamic and static versions in Linux Mint 21.1, without problems, but I have some difficulties using them in my QT project (using qtcreator).
The dynamic version work very well, but the static ones give me some errors I can't solve (I googled to find a solution but without result)
In my pro file I called (dynamic version):
Qt Code:
  1. LIBS +=-L/usr/local/lib/
  2. LIBS += -lopencv_calib3d
  3. LIBS += -lopencv_core
  4. LIBS += -lopencv_features2d
  5. LIBS += -lopencv_flann
  6. LIBS += -lopencv_highgui
  7. LIBS += -lopencv_imgcodecs
  8. LIBS += -lopencv_imgproc
  9. LIBS += -lopencv_ml
  10. LIBS += -lopencv_objdetect
  11. LIBS += -lopencv_photo
  12. LIBS += -lopencv_shape
  13. LIBS += -lopencv_stitching
  14. LIBS += -lopencv_superres
  15. LIBS += -lopencv_video
  16. LIBS += -lopencv_videoio
  17. LIBS += -lopencv_videost
To copy to clipboard, switch view to plain text mode 
and it's ok. but when I tried to use the static version replacing the previous lines with this code:
Qt Code:
  1. LIBS +=/usr/local/lib/libopencv_calib3d.a -lopencv_calib3d
  2. LIBS +=/usr/local/lib/libopencv_core.a -lopencv_core
  3. LIBS +=/usr/local/lib/libopencv_features2d.a -lopencv_features2d
  4. LIBS +=/usr/local/lib/libopencv_flann.a -lopencv_flann
  5. LIBS +=/usr/local/lib/libopencv_highgui.a -lopencv_highgui
  6. LIBS +=/usr/local/lib/libopencv_imgcodecs.a -lopencv_imgcodecs
  7. LIBS +=/usr/local/lib/libopencv_imgproc.a -lopencv_imgproc
  8. LIBS +=/usr/local/lib/libopencv_ml.a -lopencv_ml
  9. LIBS +=/usr/local/lib/libopencv_objdetect.a -lopencv_objdetect
  10. LIBS +=/usr/local/lib/libopencv_photo.a -lopencv_photo
  11. LIBS +=/usr/local/lib/libopencv_shape.a -lopencv_shape
  12. LIBS +=/usr/local/lib/libopencv_stitching.a -lopencv_stitching
  13. LIBS +=/usr/local/lib/libopencv_superres.a -lopencv_superres
  14. LIBS +=/usr/local/lib/libopencv_video.a -lopencv_video
  15. LIBS +=/usr/local/lib/libopencv_videoio.a -lopencv_videoio
  16. LIBS +=/usr/local/lib/libopencv_videostab.a -lopencv_videostab
To copy to clipboard, switch view to plain text mode 
the result is:

:-1: error: /usr/local/lib/libopencv_objdetect.a(qrcode.cpp.o): undefined reference to symbol '_ZN2cv11contourAreaERKNS_11_InputArrayEb'
:-1: error: /usr/local/lib//libopencv_imgproc.so: error adding symbols: DSO missing from command line
:-1: error: collect2: error: ld returned 1 exit status
:-1: error: [Makefile:806: TestApp] Error 1


I can't understand the reason for the undefined symbols (includes and loading order of libraries should be ok), so I am asking for help.
Note: I'm not sure about the need for -l+library parameter, but without it I received tons of errors.
Thank a lot!