我有 Mac OS Lion 10.7.5 和 xCode 4.6。我已经下载了一个opencv 模板。然后检索一个框架并想创建我自己的项目。首先我安装 cmake 2.8.10,添加一个框架,就是这样。在 main.mi 中尝试创建一个窗口:
#import <UIKit/UIKit.h>
#include "opencv2/highgui/highgui_c.h"
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
IplImage* img = cvLoadImage("1.png", 8);
cvNamedWindow("Example",CV_WINDOW_AUTOSIZE); //Thread 1: signal SIGANRT
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
在调试区域中,我得到了以下信息:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /Volumes/minijHome/Documents/xcode_mini/hillegass/advancedIOS/postCourse/openCV/clean-downloads/openCVgitClone/opencv/modules/highgui/src/window.cpp, line 652
libc++abi.dylib: terminate called throwing an exception
我必须做什么?