我将Xcode更新为5.1,并且在我的iOS应用程序项目中出现了许多使用opencv framework 2.4的错误。 我的电脑是macbook air和OSX 10.9.2。
当我编译我的项目时,当我使用Iphone Retina(3.5英寸,4英寸)模拟器时,它可以正常工作。但是当我使用Iphone Retina(4英寸64位)时,我在尝试构建和运行时收到以下消息:
ld: warning: ignoring file /Users/mike/Documents/opencv2.framework/opencv2, missing required architecture x86_64 in file /Users/mike/Documents/opencv2.framework/opencv2 (3 slices)
Undefined symbols for architecture x86_64:
"CvKNearest::CvKNearest(CvMat const*, CvMat const*, CvMat const*, bool, int)", referenced from:
-[HomeViewController ocrTicket:] in HomeViewController.o
"CvKNearest::~CvKNearest()", referenced from:
-[HomeViewController ocrTicket:] in HomeViewController.o
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
-[HomeViewController ocrTicket:] in HomeViewController.o
PreProcessImage(cv::Mat*, cv::Mat*, int, int) in HomeViewController.o
PreProcessImageNew(cv::Mat*, cv::Mat*, int, int) in HomeViewController.o
-[HomeViewController FromMat:ObtainRect:] in HomeViewController.o
...
ld: symbol(s) not found for architecture x86_64
答案 0 :(得分:10)
目标 - >构建设置 - >架构。双击 架构
,选择其他,删除
$(ARCH_STANDARD)(' - ')
,然后增加
armv7和armv7s'+'
(点)。再次编译 clean 。
答案 1 :(得分:3)
简答:从构建设置中的架构列表中删除arm64
长答案:从Xcode 5.1开始,默认是在标准构建体系结构列表中包含arm64。如果您使用没有64位切片的预编译库(如OpenCV),这将导致问题,因为链接器将无法找到有效代码。不要担心从架构列表中删除arm64。只要它在Valid Architectures列表中,它仍然可以在64位平台上运行。