설명 here과 같이 cmake
빌드 시스템을 사용하여 OpenCV 라이브러리를 빌드했으며 '.a'및 '.dylib'파일을 터미널 C++ 프로젝트에 추가했습니다. 그러나 아래 코드를 실행하면 (http://iphone-cocoa-objectivec.blogspot.com/2009/01/using-opencv-for-mac-os-in-xcode.html에서 가져옴) 아래 오류가 표시됩니다. 누구 조언있어? 어떤 도움을 많이 주시면 감사하겠습니다.Xcode에서 OpenCV C++ 오류
#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;
}
오류 OpenCV의 2.0 엑스 코드를 사용하여
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