Relative Content

Tag Archive for c++opencvvisual-studio-code

How can I make OpenCV work normally without needing to run “CMake: Run Without Debugging” in the Command Palette in VS Code?

When I run my C++ script (located at “C:Userskobe_software zoneObjectDetectionmain.cpp”) in VS Code, I get this error: “Error exists after running preLaunch Task 'C/C++: g++.exe build active file'.“, after which I push the button “Debug Anyway“, then the error “program 'C:Userskobe_software zoneObjectDetectionmain.exe' does not exist” occurs. I also see this error on my first line (#include <opencv2/opencv.hpp>): “opencv2/opencv.hpp: No such file or directory”. But now comes the crazy thing. When I go to the command palette (Ctrl+Shift+P) and type “CMake: Run Without Debugging” it works perfectly fine, and when I open this file “C:Userskobe_software zonebuildDebugObjectDetection.exe” it also works perfectly fine.