Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location Manager error

I am using location manager

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CLLocationManager", referenced from:
      objc-class-ref in ViewController.o
  "_kCLLocationAccuracyHundredMeters", referenced from:
      -[ViewController viewDidLoad] in ViewController.o
  "_kCLDistanceFilterNone", referenced from:
      -[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

I added corelocation.framework into frameworks folder of my project, the project is success on cleaning but failed and give the same three errors on building

like image 760
Najeebullah Shah Avatar asked Dec 01 '11 05:12

Najeebullah Shah


2 Answers

You need to import Framework Which you have already done also add the following to your .h file where you are using the CLLocation class such as

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface UntitledViewController : UIViewController <CLLocationManagerDelegate> {
    CLLocationManager*      locationManager;
    CLLocation*             locationObject;
}

@end

Hope it helps!!

like image 94
Rahul Sharma Avatar answered Nov 14 '22 22:11

Rahul Sharma


Removing and adding the framework back, is the correct solution. Thank for the answer, it saved me a lot work.

like image 20
Leander Avatar answered Nov 14 '22 23:11

Leander