0

我尝试从此链接运行一个基本的 opengl 程序。我可以成功运行它。现在我需要在其中添加一些opencv的功能。所以我从这个链接添加了 opencv 框架。

添加框架后,我将文件更改为 .mm 并且编译良好。当我添加“cv::Mat 变量”时,问题就来了。我收到以下错误。这会是什么原因?

以下是添加“cv::Mat 变量”时出现的错误。

  Undefined symbols for architecture i386:
  "_gzclose", referenced from:
      _cvReleaseFileStorage in OpenCV(persistence.o)
      _cvOpenFileStorage in OpenCV(persistence.o)
  "_gzeof", referenced from:
      icvEof(CvFileStorage*)      in OpenCV(persistence.o)
  "_gzgets", referenced from:
      icvGets(CvFileStorage*, char*, int)in OpenCV(persistence.o)
  "_gzopen", referenced from:
      _cvOpenFileStorage in OpenCV(persistence.o)
  "_gzputs", referenced from:
      icvPuts(CvFileStorage*, char const*)in OpenCV(persistence.o)
  "_gzrewind", referenced from:
      _cvOpenFileStorage in OpenCV(persistence.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
4

1 回答 1

1

这解决了我的问题。添加添加opencv库文件

AVFoundation.framework
ImageIO.framework
libz.dylib

应该添加。这个链接清楚地解释了这一点。http://aptogo.co.uk/2011/09/opencv-framework-for-ios/

于 2013-03-04T06:08:48.093 回答