Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5.1 build opencv failed on 64 bit simulator

Tags:

xcode

ios

opencv

I updated Xcode to 5.1 and many errors appeared in my iOS app project which use opencv framework 2.4. My computer is macbook air and OSX 10.9.2.

When I compile my project, it works fine when I'm using Iphone Retina (3.5-Inch ,4-Inch) Simulator. But when I'm using Iphone Retina (4-Inch 64-bit) I got the following message when I try to build and run :

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
like image 899
bc a Avatar asked Dec 02 '25 08:12

bc a


1 Answers

Xcode upgrade to 5.1, apple default let all app through the 64 - bit compiler. By this way can close: selected the

Targets - > Build Settings - > Architectures. Double-click the Architectures

, choose other, delete in addition to the

$(ARCH_STANDARD) (' - ')

, and then increase

armv7 and armv7s' + '

(point). Compile the clean once again.

like image 74
MackC Avatar answered Dec 05 '25 01:12

MackC