Error while implementing KMLViewer in my project
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:
_strTo开发者_运维知识库Coords
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.
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).
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?.
精彩评论