I need help installing OpenCV for C++ using msys2 Mingw C++

I tried everything, but every tutorial seems to be out of date or too simplified. I managed to get the libraries to work, but I can’t compile my code into an app. It’s really getting on my nerve. If anyone would help me,? I get this weird error. : #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit

(C:\Users\BLOCKED\Desktop\opencv_c++\test.cpp).
cannot open source file "opencv2/opencv.hpp"
or launch: program 'c:\Users\wowzie\Desktop\test finle 2\build\Debug\outDebug' does not exist

and when i tried to compile it through msys2 shell directly it gave me this error: "test.cpp:1:10: fatal error: opencv2/opencv.hpp: No such file or directory
1 | #include <opencv2/opencv.hpp>
| ^ "and i dont know why i installed everything correctly or at least i think so

If anyone wants the file that I created, you can tell me where to upload it.

please edit, and replace the useless screenshot with a TEXT version of whatever it shows, thank you

sorry i am kinda new you can check now thank you

1 Like

so, WHAT did you install, HOW, WHERE, and WHERE is your includes path pointing at ?

do you have something like a cmdline / makefile to show us ?

msys2

i’d avoid that, it’s mangling with pathes, etc.

So I installed it from MSYS2’s own website. Here is the bash link: pacman -S mingw-w64-x86_64-opencv or the real link: [Package: mingw-w64-x86_64-opencv, MSYS2 Packages] (Package: mingw-w64-x86_64-opencv - MSYS2 Packages) So after I installed it, I included its path, but it didn’t work for some reason, so I did what anyone would do and searched for another way, so I found opencv-MinGW-build on github. I followed the instructions and got the same brickwall, so I did some digging with the cmake files and tasks. json, c_cpp_properties.json, and after that, I managed to remove the "test. cpp:1:10: fatal error: opencv2/opencv.hpp: No such file or directory
1 | #include <opencv2/opencv.hpp>: "error from vscode but it appeared in msys2 shell but don’t worry about that anyway i tried everything but every time i run the code through vscode i keeps giving me the C:\Users\BLOCKED\Desktop\opencv_c++\test.cpp). cannot open source file “opencv2/opencv.hpp” or launch: program ‘c:\Users\blocked\Desktop\test finle 2\build\Debug\outDebug’

yeah i think i just wont use it because ever since i installed it and my life has been a problem i will uninstall it and try again