I'm having a problem right now with a project I'm trying to build in Xcode 4.0, hopefully someone can shed some light on this for me..
I'm trying to use the ZBar SDK and have followed the instructions outlined in the guideline outlined here:
http://zbar.sourceforge.net/iphone/sdkdoc/camera.html
however, i'm getting the same error. I checked out John's post, however, the path he mentioned wasn't in my LIBRARY_SEARCH_PATH's.
I'm using Xcode 4.0, and am trying to build my project for the iPad 4.3 Simulator.
(Error I'm getting):
Undefined symbols for architecture i386:
"_objc_msgSend", referenced from:
_main in main.o
-[PrototypeAppDelegate application:didFinishLaunchingWithOptions:] in PrototypeAppDelegate.o
-[PrototypeAppDelegate dealloc] in PrototypeAppDelegate.o
-[Home loadGRView] in Home.o
...
"开发者_C百科_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
objc-class-ref in main.o
"_objc_msgSendSuper2", referenced from:
-[PrototypeAppDelegate dealloc] in PrototypeAppDelegate.o
-[PrototypeAppDelegate_iPhone dealloc] in PrototypeAppDelegate_iPhone.o
...
"_objc_setProperty", referenced from:
-[PrototypeAppDelegate setTabBarController:] in PrototypeAppDelegate.o
-[PrototypeAppDelegate setTheNavController:] in PrototypeAppDelegate.o
...
etc.
I've tried looking at the ReaderSample code included with the ZBar sdk, and thought the issue was that I was missing a couple frameworks that they used in their app, but including those frameworks just increased the number of errors i'm getting. Is this a Build setting issue? Does anyone have ideas of what I can try doing?
P.S: I found two threads similar to this problem, and tried the various solutions they recommended and still couldn't get a solution
-http://stackoverflow.com/questions/1452466/suddenly-i-am-not-able-to-build-for-the-iphone-simulator -http://stackoverflow.com/questions/1456185/build-error-missing-required-architecture-i386-in-file/1467238#1467238
I hope I'm using this thread correctly... I'm relatively new to stack overflow. T
I was able to play around and get it working.
I updated Xcode to 4.0.2. Also, the documentation for ZBar forgot to mention the other frameworks needed to use the SDK (Take a look at the ReaderSample application). The 7 frameworks need to be in the following order:
Foundation.framework
CoreGraphics.framework
UIKit.framework
AVFoundation.framework
CoreMedia.framework
CoreVideo.framework
QuartzCore.framework
libiconv.dylib
libzbar.a
I wasn't aware the order the frameworks are declared in the Build Phases mattered. Anyways, hopefully for anybody trying to integrate a barcode scanner into their app, this answer will be useful.
I had a similar problem while writing an app that used CoreData. It turns out that the Build Phases section was not including a critical class.m file. I manually added it to the list (although it was already in the project) and everything worked fine. I have never seen Xcode ignore a project file like this before.
Add UIKit.framwork manually in Xcode build phase under “Link Binary With Libraries” Its resolved my same issue.
精彩评论