How to compile Opencv C files ??
how to compile opencv C files ?
I’m reading Learning opencv computer vision with opencv library.
I have this error with the first example I made.
#include "highgui.h" // I tried using with <opencv/highgui.h> but it keep showing the same error
int main(int argc, char** argv ){
IplImage* img = cvLoadImage( argv[1]);
cvNamedWindow("Example1", CV_WINDOW_AUTOSIZE );
cvShowImage("Example1" , img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
}
I compile using this command g++ -o example example.c pkg-config --cflags --libs opencv
user@usermob:~/tesOpen$ ./test
libusb: 0.000000 debug [libusb_init] libusb-1.0.9 git:1.0.9-28-g7634714
libusb: 0.000068 debug [find_usbfs_path] found usbfs at /dev/bus/usb
libusb: 0.000134 debug [op_init] bulk continuation flag supported
libusb: 0.000164 debug [op_init] zero length packet flag supported
libusb: 0.000204 debug [op_init] found usb devices in sysfs
libusb: 0.000302 debug [usbi_add_pollfd] add fd 4 events 1
libusb: 0.000346 debug [usbi_io_init] using timerfd for timeouts
libusb: 0.000369 debug [usbi_add_pollfd] add fd 6 events 1
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Aborted (core dumped)