Reputation: 3
Please excuse any minor mistakes, being my first question... Feedback still appreciated though.
I've been trying to use a Redpark cable, in order to communicate between an iPhone and an Arduino (Mini Arduino Pro). The project has failed to build with my coding.
I've searched around for days for a solution, but what has worked for others hasn't worked for me.
This is my error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_RscMgr", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
However, I have found that this line of code has been the problem factor. (As in, if it is removed, the project build will succeed, but will not work.)
Inside ViewController.m -(void)viewDidLoad
rscMgr = [[RscMgr alloc] init];
Frameworks ("Link Binary With Libraries"): ExternalAccessory, UIKit, MediaPlayer, CoreGraphics, Foundation.
ViewController.h (With unnecessary stuff removed)
#import <UIKit/UIKit.h> #import "RscMgr.h"
@interface ViewController : UIViewController <RscMgrDelegate> {
RscMgr *rscMgr;
}
@property (nonatomic, retain) RscMgr *rscMgr;
@end
ViewController.m (With unnecessary stuff removed)
#import "ViewController.h"
#import "RscMgr.h"
@implementation ViewController
@synthesize rscMgr;
- (void)viewDidLoad
{
[super viewDidLoad];
rscMgr = [[RscMgr alloc] init];
[rscMgr setDelegate:self];
}
-(void) cableConnected:(NSString *)protocol{
[rscMgr setBaud:9600];
[rscMgr open];
}
@end
Links to RscMgr.h and redparkSerial.h
There are no .m files for both redparkSerial.h and RscMgr.h
Upvotes: 0
Views: 386
Reputation: 73936
This is a linker error. You are referencing the library headers files correctly, so the compiler can compile the individual files into object files, but when the linker comes to join them all together into an application, it is finding that the library itself is not present. You need to add the library itself to your project. The headers only describe the interface to it, they don't include the library itself.
To do this in recent versions of Xcode, you can usually just drag the static library (a file ending in .a
) into your project. But you should really check the documentation for this library and follow its recommended installation procedure.
Upvotes: 1