J'ai construit les bibliothèques OpenCV en utilisant le système de construction cmake
comme décrit here et j'ai ajouté l'en-tête, les fichiers '.a' et '.dylib' à mon projet C++ terminal. Cependant quand je cours le code ci-dessous (l'ai obtenu de http://iphone-cocoa-objectivec.blogspot.com/2009/01/using-opencv-for-mac-os-in-xcode.html), il me donne les erreurs ci-dessous. Quelqu'un at-il eu des conseils? Toute aide sera très appréciée.Erreur OpenCV C++ dans Xcode
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
int main()
{
//get the image from the directed path
IplImage* img = cvLoadImage("/Users/somedir/Programming/TestProj/fruits.jpg", 1);
//create a window to display the image
cvNamedWindow("picture", 1);
//show the image in the window
cvShowImage("picture", img);
//wait for the user to hit a key
cvWaitKey(0);
//delete the image and window
cvReleaseImage(&img);
cvDestroyWindow("picture");
//return
return 0;
}
erreurs
Undefined symbols:
"_cvLoadImage", referenced from:
_main in main.o
"_cvNamedWindow", referenced from:
_main in main.o
"_cvReleaseImage", referenced from:
_main in main.o
"_cvShowImage", referenced from:
_main in main.o
"_cvDestroyWindow", referenced from:
_main in main.o
"_cvWaitKey", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status