Bonjour tout le monde,

J'ai un problème de linkage d'OpenCV, j'utilise les librairies static (.a), et je n'arrive pas à faire le linkage dans le fichier (.pro), est ce que quelqu'un a une idée? Je vous remercie d'avance.

Le fichier .PRO:

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
QT       += core gui
 
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
 
TARGET = Test
    target.files = Test
    target.path = /home/root
INSTALLS += target
 
TARGET = Test
TEMPLATE = app
 
#INCLUDEPATH += "/usr/local/include/opencv" "/usr/local/include/opencv2"
#LIBS +=  -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
 
INCLUDEPATH += "/opt/opencv2.3/include" "/opt/opencv2.3/include/opencv" "/opt/opencv2.3/include/opencv2"
LIBS += "-L/opt/opencv2.3/lib" -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
 
 
SOURCES += main.cpp \
        mainwindow.cpp \
        Test2.cpp
 
HEADERS  += mainwindow.h
 
FORMS    += mainwindow.ui
et voici les erreurs que ça génère, j'ai pas mis tout les erreurs car la fenêtre ne supporte pas ... :
Code x : 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
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::Mat::release()':
cap.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x4c): undefined reference to `cv::Mat::deallocate()'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::VideoWriter::write(cv::Mat const&)':
cap.cpp:(.text._ZN2cv11VideoWriter5writeERKNS_3MatE+0x10): undefined reference to `cv::Mat::operator _IplImage() const'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::Ptr<CvVideoWriter>::release()':
cap.cpp:(.text._ZN2cv3PtrI13CvVideoWriterE7releaseEv[cv::Ptr<CvVideoWriter>::release()]+0x5c): undefined reference to `cv::fastFree(void*)'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::Ptr<CvCapture>::release()':
cap.cpp:(.text._ZN2cv3PtrI9CvCaptureE7releaseEv[cv::Ptr<CvCapture>::release()]+0x5c): undefined reference to `cv::fastFree(void*)'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::Mat::~Mat()':
cap.cpp:(.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x54): undefined reference to `cv::fastFree(void*)'
cap.cpp:(.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x64): undefined reference to `cv::Mat::deallocate()'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::VideoCapture::read(cv::Mat&)':
cap.cpp:(.text._ZN2cv12VideoCapture4readERNS_3MatE+0xe4): undefined reference to `cv::Mat::deallocate()'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::VideoCapture::operator>>(cv::Mat&)':
cap.cpp:(.text._ZN2cv12VideoCapturersERNS_3MatE+0x88): undefined reference to `cv::Mat::deallocate()'
/opt/opencv2.3/lib/libopencv_highgui.a(cap.o): In function `cv::VideoCapture::retrieve(cv::Mat&, int)':
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x4c): undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0xd4): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x150): undefined reference to `cv::fastFree(void*)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x16c): undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x17c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x18c): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x19c): undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x1ec): undefined reference to `cv::fastFree(void*)'
cap.cpp:(.text._ZN2cv12VideoCapture8retrieveERNS_3MatEi+0x238): undefined reference to `cv::Mat::deallocate()'
loadsave.cpp:(.text._ZN2cv8imencodeERKSsRKNS_11_InputArrayERSt6vectorIhSaIhEERKS5_IiSaIiEE+0x430): undefined reference to `cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
loadsave.cpp:(.text._ZN2cv8imencodeERKSsRKNS_11_InputArrayERSt6vectorIhSaIhEERKS5_IiSaIiEE+0x438): undefined reference to `cv::error(cv::Exception const&)'
loadsave.cpp:(.text._ZN2cv8imencodeERKSsRKNS_11_InputArrayERSt6vectorIhSaIhEERKS5_IiSaIiEE+0x440): undefined reference to `cv::Exception::~Exception()'
loadsave.cpp:(.text._ZN2cv8imencodeERKSsRKNS_11_InputArrayERSt6vectorIhSaIhEERKS5_IiSaIiEE+0x4fc): undefined reference to `cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
...
collect2: ld returned 1 exit status
make: *** [Test] Error 1
09:37:27: Le processus "/usr/bin/make" s'est terminé avec le code 2.
Error while building/deploying project Test (kit: BeagleboneKit)
Lors de l'exécution de l'étape "Make"