Reputation: 4547
I am importing a third party project, which has its own framework. I wish to study that API, when I am trying to open that project, I am getting
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_T0Command", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_T1Command", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_iSmart", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have spent almost one and half hour searching for the solution.
Link Binaries with Libraries
contains the desired framework, it was missing initially I have already added
The project has been build and clean several times.
EDIT 1 I have run the 'file' command using terminal on the binary of the framework
file iSmartSDK
iSmartSDK: Mach-O universal binary with 2 architectures
iSmartSDK (for architecture armv7): Mach-O object arm
iSmartSDK (for architecture armv6): Mach-O object arm
Upvotes: 3
Views: 240
Reputation: 1593
I think your ViewController.m
is not added into the target's
compiled source
s in build phases
.
Update 1: set "Build Active Architectures Only" to yes.
Target
--> Build Settings
Update 2: Check that you have not written #import "ViewController.m"
. !!
Upvotes: 1
Reputation: 6991
It looks like the framework is only compiled for ARM, and not for Intel ( i386 ). Try running it on your iPhone and see what happens..
alternatively you can run the 'file' command using terminal on the binary of the framework to check and see what architectures it supports. Is the 3rd party framework opensource? you should probably download the source, include it in your project and compile it every time you build your project so you won't have such issues..
Upvotes: 2