Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 13, 2008, 04:41 PM   #1
nujjus
macrumors newbie
 
Join Date: Apr 2008
Linking Errors

Hi!

I was wondering if anyone might know why I get the following linking errors when I try to compile and run the Apple CoreLocation sample code:


"_kCLLocationAccuracyKilometer", referenced from:
_kCLLocationAccuracyKilmoeter$non_lazy_ptr in MyLocationGetter.o


and

".objc_class_name_CLLocationManager", referened from:
literal-pointer@__OBJC@__cls_refs@CLLocationManager in MyLocationGetter.o
symbol(s) not found
collect2: ld returned 1 exit status



In my header file, I've imported <CoreLocation/CoreLocation.h> and I've declared locationManager as a class property. The class extends NSObject and conforms to CLLocationManagerDelegate.



My .m file looks like this:
Code:
#import "MyLocationGetter.h"

@implementation MyLocationGetter 

@synthesize locationManager;

- (void)startUpdates 
{ 
	// Create the location manager if this object does not 
	// already have one. 
	if (nil == locationManager) 
		locationManager = [[CLLocationManager alloc] init];		//it appears to have beef with CLLocationManager
	locationManager.delegate = self; 
	locationManager.distanceFilter = 1000; // 1 kilometer 
	locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;		//it appears to have beef with kCLLocationaccuracyKilometer
	[locationManager startUpdatingLocation]; 
}
Any help is appreciated, thanks!
nujjus is offline   0 Reply With Quote
Old Apr 13, 2008, 04:49 PM   #2
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Have you included the relevant frameworks in your project?
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Apr 13, 2008, 05:03 PM   #3
nujjus
Thread Starter
macrumors newbie
 
Join Date: Apr 2008
I thought so..

my header file has both:

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


Looking into the framework, CoreLocation has:

Code:
#ifndef __CORELOCATION__
#define __CORELOCATION__

#import <CoreLocation/CLLocation.h>
#import <CoreLocation/CLLocationManager.h>
#import <CoreLocation/CLLocationManagerDelegate.h>

#endif /* __CORELOCATION__ */
which includes what I need.
nujjus is offline   0 Reply With Quote
Old Apr 13, 2008, 05:10 PM   #4
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
No you actually need to add the framework to your project. Just including the header files is not enough.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Apr 13, 2008, 05:29 PM   #5
nujjus
Thread Starter
macrumors newbie
 
Join Date: Apr 2008
Thank you SO much!!
nujjus is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
missing LINKING error bonovox iPhone/iPad Programming 1 May 2, 2014 02:24 AM
Linking new internet account lewis82 OS X Mavericks (10.9) 4 Oct 26, 2013 09:26 PM
linking in Mail fatmallon Mac Applications and Mac App Store 1 Mar 15, 2013 02:18 PM
Linking Max Minis SpecialEd Mac mini 7 Jul 24, 2012 02:37 PM
Intra-page linking John444 Web Design and Development 12 Jun 14, 2012 08:26 AM

Forum Jump

All times are GMT -5. The time now is 05:23 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC