Hi,
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...
	
	- void scanqr::processQR() 
-    { 
-     Mat qrframe; 
-     if(cap.read(qrframe)){ 
-   
- *		QRCodeDetector decoder = cv::QRCodeDetector(); 
-   
- 		cv::cvtColor(qrframe,qrframe,COLOR_BGR2RGB); 
-   
-        std::vector<Point> points; 
- **     std::string data = decoder.detectAndDecode(qrframe, points); 
-   
-   
- 	   ...... 
        void scanqr::processQR()
   {
    Mat qrframe;
    if(cap.read(qrframe)){
*		QRCodeDetector decoder = cv::QRCodeDetector();
		cv::cvtColor(qrframe,qrframe,COLOR_BGR2RGB);
       std::vector<Point> points;
**     std::string data = decoder.detectAndDecode(qrframe, points);
       QString scanned_code= QString::fromStdString(data);
	   
	   ......
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:
	
	- #    INCLUDEPATH += C:\opencv-3.4.16\BUILD-static\install\include 
-     INCLUDEPATH += C:\opencv-3.4.16\BUILD-dynamic\install\include 
-   
- #     LIBS += -LC:/opencv-3.4.16/BUILD-static/install/x64/mingw/staticlib 
-      LIBS += -LC:/opencv-3.4.16/BUILD-dynamic/install/x64/mingw/staticlib 
-   
- 	 LIBS += -llibopencv_core3416 -llibopencv_imgproc3416 -llibopencv_features2d3416 -llibopencv_highgui3416 -llibopencv_calib3d3416 -llibopencv_imgcodecs3416 -llibopencv_video3416 -llibopencv_videoio3416 -llibopencv_videostab3416 
        #    INCLUDEPATH += C:\opencv-3.4.16\BUILD-static\install\include
    INCLUDEPATH += C:\opencv-3.4.16\BUILD-dynamic\install\include
#     LIBS += -LC:/opencv-3.4.16/BUILD-static/install/x64/mingw/staticlib
     LIBS += -LC:/opencv-3.4.16/BUILD-dynamic/install/x64/mingw/staticlib
	 
	 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!
				
			
Bookmarks