Hello, I would like to compile a simple OpenCV application in Qt.
I already looked at Qt-OpenCV-simple-example topic but its too complicated for me at the moment. I followed a great tutorial on YouTube.
Unfortunately I can't get it working, that's why I'm asking for help.
Miscellaneous information :
Ubuntu 13.04 (64 bits)
Qt Creator 2.7.0
Qt framework 5.0.1 (64 bits)
OpenCV 2.4.4
rc libopencv-calib3d2.3 2.3.1-11ubuntu2 amd64 computer vision Camera Calibration library
ii libopencv-calib3d2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Camera Calibration library
rc libopencv-contrib2.3 2.3.1-11ubuntu2 amd64 computer vision contrib library
rc libopencv-core2.3 2.3.1-11ubuntu2 amd64 computer vision core library
ii libopencv-core2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision core library
rc libopencv-features2d2.3 2.3.1-11ubuntu2 amd64 computer vision Feature Detection and Descriptor Extraction library
ii libopencv-features2d2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Feature Detection and Descriptor Extraction library
rc libopencv-flann2.3 2.3.1-11ubuntu2 amd64 computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-flann2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Clustering and Search in Multi-Dimensional spaces library
rc libopencv-gpu2.3 2.3.1-11ubuntu2 amd64 computer vision GPU Processing library
rc libopencv-highgui2.3 2.3.1-11ubuntu2 amd64 computer vision High-level GUI and Media I/O library
ii libopencv-highgui2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision High-level GUI and Media I/O library
rc libopencv-imgproc2.3 2.3.1-11ubuntu2 amd64 computer vision Image Processing library
ii libopencv-imgproc2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Image Processing library
rc libopencv-legacy2.3 2.3.1-11ubuntu2 amd64 computer vision legacy library
ii libopencv-legacy2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision legacy library
rc libopencv-ml2.3 2.3.1-11ubuntu2 amd64 computer vision Machine Learning library
ii libopencv-ml2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Machine Learning library
rc libopencv-objdetect2.3 2.3.1-11ubuntu2 amd64 computer vision Object Detection library
ii libopencv-objdetect2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Object Detection library
rc libopencv-video2.3 2.3.1-11ubuntu2 amd64 computer vision Video analysis library
ii libopencv-video2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Video analysis library
rc libopencv-calib3d2.3 2.3.1-11ubuntu2 amd64 computer vision Camera Calibration library
ii libopencv-calib3d2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Camera Calibration library
rc libopencv-contrib2.3 2.3.1-11ubuntu2 amd64 computer vision contrib library
rc libopencv-core2.3 2.3.1-11ubuntu2 amd64 computer vision core library
ii libopencv-core2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision core library
rc libopencv-features2d2.3 2.3.1-11ubuntu2 amd64 computer vision Feature Detection and Descriptor Extraction library
ii libopencv-features2d2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Feature Detection and Descriptor Extraction library
rc libopencv-flann2.3 2.3.1-11ubuntu2 amd64 computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-flann2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Clustering and Search in Multi-Dimensional spaces library
rc libopencv-gpu2.3 2.3.1-11ubuntu2 amd64 computer vision GPU Processing library
rc libopencv-highgui2.3 2.3.1-11ubuntu2 amd64 computer vision High-level GUI and Media I/O library
ii libopencv-highgui2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision High-level GUI and Media I/O library
rc libopencv-imgproc2.3 2.3.1-11ubuntu2 amd64 computer vision Image Processing library
ii libopencv-imgproc2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Image Processing library
rc libopencv-legacy2.3 2.3.1-11ubuntu2 amd64 computer vision legacy library
ii libopencv-legacy2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision legacy library
rc libopencv-ml2.3 2.3.1-11ubuntu2 amd64 computer vision Machine Learning library
ii libopencv-ml2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Machine Learning library
rc libopencv-objdetect2.3 2.3.1-11ubuntu2 amd64 computer vision Object Detection library
ii libopencv-objdetect2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Object Detection library
rc libopencv-video2.3 2.3.1-11ubuntu2 amd64 computer vision Video analysis library
ii libopencv-video2.4 2.4.2+dfsg-0exp2ubuntu1 amd64 computer vision Video analysis library
To copy to clipboard, switch view to plain text mode
The Youtube tutorial is for Windows, I modified the .pro file and it looks like this :
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QtTracker3
TEMPLATE = app
SOURCES += main.cpp\
dialog.cpp
HEADERS += dialog.h
FORMS += dialog.ui
# Show Qt where OpenCV is :
INCLUDEPATH += /usr/local/include/opencv #/usr/local/include/opencv2
LIBS += -L/usr/local/lib \
-lopencv_calib3d \
-lopencv_contrib \
-lopencv_core \
-lopencv_features2d \
-lopencv_flann \
-lopencv_gpu \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_legacy \
-lopencv_ml \
-lopencv_objdetect \
-lopencv_ts \
-lopencv_video
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QtTracker3
TEMPLATE = app
SOURCES += main.cpp\
dialog.cpp
HEADERS += dialog.h
FORMS += dialog.ui
# Show Qt where OpenCV is :
INCLUDEPATH += /usr/local/include/opencv #/usr/local/include/opencv2
LIBS += -L/usr/local/lib \
-lopencv_calib3d \
-lopencv_contrib \
-lopencv_core \
-lopencv_features2d \
-lopencv_flann \
-lopencv_gpu \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_legacy \
-lopencv_ml \
-lopencv_objdetect \
-lopencv_ts \
-lopencv_video
To copy to clipboard, switch view to plain text mode
The project builds successfuly but the program exits at start.
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Ioctl() inappropr\303\251 pour un p\303\251riph\303\251rique\n"
no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Ioctl() inappropr\303\251 pour un p\303\251riph\303\251rique\n"
no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
To copy to clipboard, switch view to plain text mode
0 ?? /usr/lib/x86_64-linux-gnu/libQtTest.so.4 0x7fffeff97d3c
1 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7de9876
2 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7de9930
3 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7ddb68a
4 ?? 0x1
5 ?? 0x7fffffffe920
6 ??
0 ?? /usr/lib/x86_64-linux-gnu/libQtTest.so.4 0x7fffeff97d3c
1 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7de9876
2 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7de9930
3 ?? /lib64/ld-linux-x86-64.so.2 0x7ffff7ddb68a
4 ?? 0x1
5 ?? 0x7fffffffe920
6 ??
To copy to clipboard, switch view to plain text mode
The arrow points this line
0x7fffeff97d3c <+0x0000> lock incl (%rbx)
0x7fffeff97d3c <+0x0000> lock incl (%rbx)
To copy to clipboard, switch view to plain text mode
The whole project is enclosed in this post (QtTest_Vic.zip). Thanks in advance for your precious help
Bookmarks