Initially I was doing a project, but video part was not working, then I decided to write a simple code to check how it was working with video (camera). And I got this error, but cannot realize why:
openOpenCV(3.4.3) Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvWaitKey, file /home/Ulugbe/Downloads/Telegram Desktop/opencv-3.4.3/modules/highgui/src/window.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.3) /home/Ulugbe/Downloads/Telegram Desktop/opencv-3.4.3/modules/highgui/src/window.cpp:698: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'
#include <dlib/any.h>
#include <iostream>
int main (int argc, char **argv)
{
std::cout << cv::getBuildInformation() << std::endl;
cv::VideoCapture video(0);
// video.open("/home/Ulugbe/oson/ulugbek_face.mp4");
if(video.isOpened())
std::cout<<"open";
cv::Mat frame;
video.read(frame);
cv::imshow("image", frame);
cv::waitKey(0);
video.release();
return 0;
}
I cannot understand the error because the opencv version in the message is not suitable with my current one and the path shown in the error also doesn't exist (But I remembered it was initially installed there but it was then uninstalled and installed as root).
If you comment imshow
and waitKey
the program will not show any errors that's why I decided the problem is somehow related to it.
Here are some pictures of my NetBeans configuration: compiler properties linker properties
Aucun commentaire:
Enregistrer un commentaire