Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create CLLocation object

Tags:

iphone

I am trying to create CLLocation object by using both init methods but its not creating and giving the error. Below is the lines of code:

CLLocationCoordinate2D locCor = userLoc.coordinate;

CLLocation *locloc = [[CLLocation alloc] initWithLatitude:userLoc.coordinate.latitude longitude:userLoc.coordinate.longitude;

Below is the error i am getting

"_OBJC_CLASS_$_CLLocation", referenced from:

  objc-class-ref-to-CLLocation in MyMap.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

Please help, I don't know why its coming. I am using XCode version 3.2.4. Is it something to do with the version?

Thanks in advance.

like image 976
Amarpreet Avatar asked Nov 11 '10 02:11

Amarpreet


1 Answers

Make sure to #import and link against the CoreLocation framework.

like image 127
Justin Avatar answered Oct 02 '22 00:10

Justin