I'm trying to compile my code on Windows 10, with OpenCV 3.4.15 and QT. I work both with Linux and Windows, and usually I haven't particular problems when I compile my app under these different SOs.
Now I'm placing a simple function (common in a lot of examples you can find in internet) for recognizing and reading a QR code from a webcam. Under Linux, all OK, under Windows...KO. I tried to recompile OpenCV (3.4.15 and 3.4.16), I used dynamically or statically linked library, I used QT 5.13.2, 5.15.2 and 5.15.7, I modified the order of libraries in *.pro file...

Qt Code:
  1. void scanqr::processQR()
  2. {
  3. Mat qrframe;
  4. if(cap.read(qrframe)){
  6. * QRCodeDetector decoder = cv::QRCodeDetector();
  8. cv::cvtColor(qrframe,qrframe,COLOR_BGR2RGB);
  10. std::vector<Point> points;
  11. ** std::string data = decoder.detectAndDecode(qrframe, points);
  13. QString scanned_code= QString::fromStdString(data);
  15. ......
To copy to clipboard, switch view to plain text mode 

*C:\Users\......scanqr.cpp:87: error: undefined reference to `cv::QRCodeDetector::QRCodeDetector()'
**C:\Users\......scanqr.cpp:94: error: undefined reference to `cv::QRCodeDetector::detectAndDecode(cv::_InputArr ay const&, cv::_OutputArray const&, cv::_OutputArray const&)'

As I said, I think it's not a problem about the syntax, because it works under Linux.
On the other hand, it's difficult for me considering it's caused by OpenCV libraries, as I compiled them in different ways and versions, with the same result. If I comment this function, app is launched and the other OpenCv features (as video acquiring and recording ) work properly.

In *.pro file I have this reference to OpenCV:

Qt Code:
  1. # INCLUDEPATH += C:\opencv-3.4.16\BUILD-static\install\include
  2. INCLUDEPATH += C:\opencv-3.4.16\BUILD-dynamic\install\include
  4. # LIBS += -LC:/opencv-3.4.16/BUILD-static/install/x64/mingw/staticlib
  5. LIBS += -LC:/opencv-3.4.16/BUILD-dynamic/install/x64/mingw/staticlib
  7. LIBS += -llibopencv_core3416 -llibopencv_imgproc3416 -llibopencv_features2d3416 -llibopencv_highgui3416 -llibopencv_calib3d3416 -llibopencv_imgcodecs3416 -llibopencv_video3416 -llibopencv_videoio3416 -llibopencv_videostab3416
To copy to clipboard, switch view to plain text mode 

Any suggestion?
Thank a lot!