How to use OPENCV 2.4.10 with QTCreator 3.4.1
HI all, i want to use opencv with qtcreator on ubutnu 14.04 , can you help me to do this .
i have followed this link http://rodrigoberriel.com/2014/11/usi... but i get an error in compilation : cannot find -lopencv_imgcodecs
update : by doing pkg-config --libs opencv i cant find something like /usr/local/lib/libopencv_imgcodecs.so
the output of pkg-config --libs opencv
/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so /usr/local/lib/libopencv_viz.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so -ltbb -lrt -lpthread -lm -ldl
and pkg-config --cflags opencv is
-I/usr/local/include/opencv -I/usr/local/include The source file :
The project configuration file ---------------------------------------------------------------------
thanks a lot
you have to build and install opencv, before you can use it for your qt project
@berak , yes i have done that and i am working fine with opencv in command line ... please see the output comment in the updated post
if it finds
/usr/local/lib/libopencv_contrib.so
(or opencv_legacy), - that must be opencv2.4, not 3.0.looks like you got conflicting opencv installs on your box
@berak oh yes sorry it's opencv 2.4.10
again, opencv_imgcodecs is a 3.0 module, does not exist in 2.4
so what's the equivalent of opencv_imgcodecs in opencv 2.4.10 ?
highgui, probably.
@berak i have deleted the libs and added LIBS +=
pkg-config opencv --libs
to the .pro file project ... now the error disapeared but i get realloc(): invalid pointer if i put any instruction related to opencvremove what you have added and add the following:
it should work. Otherwise, what you can do is to go on the project at the left column (Active Projects View) --> right click --> Add Library... --> System Package --> and at the Package field write
opencv
and that should be ;-)@theodore ok now i have added the 2 lines and tried by system package => the compilation worked if i don't have some manipulation in opencv like just cv::Mat frame; (the same thing previously mentionned) .... if i add smth like cv::VideoCapture cap(0); or cv::Mat test_image = cv::imread("elarbi.jpg"); or cv::namedWindow("Disp"); i got the same error and the msg The program has crashed (it's the same thing as previously ) => i'm wondering what could be the problem because i don't have any errors in the opencv headers that i have included in the main.cpp ..... thanks