Salut,
Je cherche à compiler un petit projet Qt qui utilise OpenCV. Je suis sous Ubuntu 12.04 (64 bits).
J'ai suivi ce tutoriel et j'ai compilé la version 2.4.3 d'OpenCV.
Le projet Qt est assez simple, je l'ai trouvé ici
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 victor@test:~/OpenCV-2.4.3/build$ cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_FFMPEG=ON .. -- Detected version of GNU GCC: 46 (406) -- Found OpenEXR: /usr/lib/libIlmImf.so -- checking for module 'gstreamer-base-0.10' -- package 'gstreamer-base-0.10' not found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for libavformat/avformat.h -- Looking for libavformat/avformat.h - found -- Looking for ffmpeg/avformat.h -- Looking for ffmpeg/avformat.h - not found CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "4.1") -- Found Sphinx Sphinx v1.1.3: /usr/bin/sphinx-build -- -- General configuration for OpenCV 2.4.3 ===================================== -- -- Platform: -- Host: Linux 3.5.0-23-generic x86_64 -- CMake: 2.8.7 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Configuration: Release -- -- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /usr/bin/c++ (ver 4.6.3) -- C++ flags (Release): -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3 -- C Compiler: /usr/bin/gcc -- C flags (Release): -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG -- C flags (Debug): -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3 -- Linker flags (Release): -- Linker flags (Debug): -- Precompiled headers: NO -- -- OpenCV modules: -- To be built: core imgproc flann highgui features2d calib3d ml video objdetect contrib nonfree photo legacy gpu python stitching ts videostab -- Disabled: world -- Disabled by dependency: - -- Unavailable: androidcamera java ocl -- -- GUI: -- QT 4.x: YES (ver 4.8.1 EDITION = OpenSource) -- QT OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libQtOpenGL.so) -- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so) -- -- Media I/O: -- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.3.4) -- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver ) -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.46) -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 3.9.5) -- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1) -- OpenEXR: /usr/lib/libImath.so /usr/lib/libIlmImf.so /usr/lib/libIex.so /usr/lib/libHalf.so /usr/lib/libIlmThread.so (ver 1.6.1) -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.2.0) -- FFMPEG: YES -- codec: YES (ver 53.35.0) -- format: YES (ver 53.21.1) -- util: YES (ver 51.22.1) -- swscale: YES (ver 2.1.0) -- gentoo-style: YES -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: Using libv4l (ver 0.8.6) -- XIMEA: NO -- Xine: NO -- -- Other third-party libraries: -- Use IPP: NO -- Use TBB: YES (ver 4.0 interface 6000) -- Use Cuda: NO -- Use OpenCL: NO -- Use Eigen: YES (ver 2.0.17) -- -- Python: -- Interpreter: /usr/bin/python (ver 2.7.3) -- Libraries: /usr/lib/libpython2.7.so -- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.1) -- packages path: lib/python2.7/dist-packages -- -- Documentation: -- Build Documentation: YES -- Sphinx: /usr/bin/sphinx-build (ver Sphinx v1.1.3) -- PdfLaTeX compiler: /usr/bin/pdflatex -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- Examples: YES -- -- Install path: /usr/local -- -- cvconfig.h is in: /home/victor/OpenCV-2.4.3/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done -- Build files have been written to: /home/victor/OpenCV-2.4.3/build
Voilà le fichier .PRO adapté pour Linux :
A la compilation j'ai ces deux erreurs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #------------------------------------------------- # # Project created by QtCreator 2013-03-24T11:56:13 # #------------------------------------------------- QT += core gui TARGET = OpenCV_Webcam TEMPLATE = app INCLUDEPATH += /usr/local/include/opencv LIBS += -L/usr/local/lib -lopencv_ffmpeg -llibopencv_gpu -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -opencv_flann -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_video SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui
Voilà ma question : comment compiler OpenCV pour que ça marche ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 erreur : cannot find -lopencv_ffmpeg erreur : cannot find -llibopencv_gpu
Merci d'avance![]()
Partager