Install Opencv and QT (no tutorial worked yet)

Hello,

I know this question was asked many times. I tried at least as often as this quesition was asked to run opencv on QT.

I tried three full days by now. I really did not want to ask in here but I think I am really stuck. I tried almost any tutorial (with cmake or without, mingw or msvc), tried 64 Bit and 32 Bit, downloaded severeal QT and opencv Versions (the versions used in the tutorials).

Sometimes I ran into errors while compiling with mingw32 (on command line), sometimes within cmake, and more often in QT itself. (Could not find modules.hpp/core.hpp…etc, unreferenced object cv, Mat , etc etc)

I would just like to use opencv on a 32 Bit qt application. Never mind which version of opencv or qt.

Does anyone has a working solution (I maybe did not tried yet)? Or could help with specific errors on specific procedurs.

I would be so happy.
Thanks a lot in advance,.

sorry, but we won’t / can’t write a tutorial for you.

and if you need help, you need to show us the exact steps taken, and the concise error resulting (you have all our sympathy, but whining does NOT help here)

and maybe it’s a good idea to start with building opencv only, once that works, add qt.

I already build opencv with visual studio - this works

It is just that no tutorial works for me. Maybe you know a more recent tutorial I could follow.

Or maybe you have a fully build (with cmake) folder with everything I need so I could use this one. Maybe something like this even exists on github or somewhere else. I just cant find it

Just one example (but this is already obvious why it wont work)
When I follow this tutorial qt cant find any of the lib files. Which is obvious because I cant find them too. I just downloaded the default folder (like advised) and then I include everything like wanted but receive many errors.

Another examples (other tutorials) that I get a linker error because I refer to unreferenced objects). Which I do not understand since I did everything what they told me in the tutorial.

other tutorial

sorry to say so, but “how to compile qt using mingw” is somewhat off-topic here.

we can however help building opencv, if you give us the required information

what information can I give you?

I just wanted to try this forum. Sorry if this is too offtopic. I will delete my question then.

  • os / compiler used
  • cmake cmdline / console output
  • make output (if you got that far)
  • resulting errors / problems

If I get to the point (without errors on command line or cmake) I always get these errors for example. I will try a few tutorials again and document the erros.

your ide is misconfigured, you’re not linking opencv libs

(and please, spare us further screenshots of code or errors, they’re useless, can’t be searched, indexed, etc , post TEXT instead, thank you)

I tried this tutorial and received the same errors.

I used mingw32 Bit compiler, cmake-3.19.8-win32-x86.msi.
Command line: mingw32-make

I linked the libraries (as told in the tutorial) trough a .pri file (I also tried the other direct way).

error: undefined reference to ‘cv::fastFree(void*)’

sorry, but mentioning (video) tutorials does not help, we need to see what YOU did, not someone else

hopefully that means, that you built those before (using cmake /mingw32-make)
check ?

you probably meant a .pro file, but where is it ? we need to SEEEE it, if you need help with it

means, you do not link against opencv_core452 (or opencv_world452) correctly

this is the .pri file
INCLUDEPATH += C:\opencv-3.4.3\build\install\include2
LIBS += -L"C:\opencv-3.4.3\build\install\x86\mingw\bin"
libopencv_aruco343
libopencv_bgsegm343
libopencv_bioinspired343
libopencv_calib3d343
libopencv_ccalib343
libopencv_core343
libopencv_cvv343
libopencv_datasets343
libopencv_dnn_objdetect343
libopencv_dnn343
libopencv_dpm343
libopencv_face343
libopencv_features2d343
libopencv_flann343
libopencv_fuzzy343
libopencv_hfs343
libopencv_highgui343
libopencv_img_hash343
libopencv_imgcodecs343
libopencv_imgproc343
libopencv_line_descriptor343
libopencv_ml343
libopencv_objdetect343
libopencv_optflow343
libopencv_phase_unwrapping343
libopencv_photo343
libopencv_plot343
libopencv_reg343
libopencv_rgbd343
libopencv_saliency343
libopencv_shape343
libopencv_stereo343
libopencv_stitching343
libopencv_structured_light343
libopencv_superres343
libopencv_surface_matching343
libopencv_text343
libopencv_tracking343
libopencv_video343
libopencv_videoio343
libopencv_videostab343
libopencv_xfeatures2d343
libopencv_ximgproc343
libopencv_xobjdetect343
libopencv_xphoto343