full error message: terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.9.0-dev) /home/princess-ellie/opencv/modules/highgui/src/window.cpp
I'm using vsCode as my code editor.
CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0) project(img_processing VERSION 0.1.0 LANGUAGES C CXX) find_package( OpenCV REQUIRED ) include_directories( ${OpenCV_INCLUDE_DIRS} ) add_executable(img_processing main.cpp) target_link_libraries( img_processing ${OpenCV_LIBS} ) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) main.cpp
#include #include int main(int, char **) { cv::Mat image; image = cv::imread("lena.jpg", cv::IMREAD_COLOR); cv::namedWindow("Lena", cv::WINDOW_AUTOSIZE); cv::imshow("Lena", image); return 0; } c_cpp_properties.json
{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/home/princess-ellie/opencv/include", "/usr/local/include/opencv4", "/usr/local/lib", "/usr/local/bin" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c23", "intelliSenseMode": "linux-gcc-x64", "cppStandard": "c++23" } ], "version": 4 } a weird part about it, it worked on my other project before I changed the name of the folder and project, then I decided to delete it and start with a new project but now the issue still persists. I'm assuming it is something with vscode configurations but have no idea and would like this issue solved.
Источник: https://stackoverflow.com/questions/780 ... he-functio
Мобильная версия