0

I have included the class KMLParser.m of Apple's KML Viewer in my project.The problem that I have is that when I try to build the project i get two errors like these:

_CLLocationCoordinate2DMake,referenced from: _strToCoords in KMLParser.o

_CLLocationCoordinate2DisValid, referenced from: _strToCoords in KMLParser.m

I don't have any idea why this error occurs, because i have left the files KMLParser.m and KMLParser.h intact, I haven't made any change to them.When I build KML Viewer, everything is fine. Please,illuminate me.

Hari
  • 1,509
  • 15
  • 34

2 Answers2

1

I am also working on implementing KMLViewer in my project. Turns out that accidentally linking with the incorrect target will cause the same errors.

For XCode 4.x, under the list of Targets, it could be that there are multiple targets, such as MyApp and MyAppTests. Select the correct target (e.g., MyApp), then add the framework(s).

Thomas Verbeek
  • 2,361
  • 28
  • 30
0

You need to add the Core Location framework to your project (an #import alone is not enough).

For Xcode 3.x, right-click on the project file and go to Add - Existing Frameworks.

For Xcode 4.x, see How to "add existing frameworks" in Xcode 4?.

Community
  • 1
  • 1
  • I've done that, I have added the framework but the error persists. Any idea? – Hari Sep 23 '11 at 15:12
  • So you copied the KMLParser.h and KMLParser.m files to your project folder, added the files to the project, and added the two frameworks? –  Sep 23 '11 at 16:39
  • Yes.Also included relevant code to my ViewController.That's why I don't have any idea why this occurs. – Hari Sep 23 '11 at 19:22
  • In Xcode, open the Target until you get to Link Binary With Libraries. Make sure Core Location and MapKit are there. –  Sep 23 '11 at 19:43
  • Thank God! I solved the problem! I had copied unintentionally the Core Location Framework in my project folder, and that was the problem.I don't understand why, but it seems that removing it from my project folder fixed the error problem.Anyway, thanks a lot for your answers (a lot).Those helped me think about something wrong with CL Framework.Thanks again! – Hari Sep 26 '11 at 12:32