Error while implementing KMLViewer in my project

梦想的初衷 提交于 2020-01-06 05:10:51

问题


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.


回答1:


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?.




回答2:


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).



来源:https://stackoverflow.com/questions/7530733/error-while-implementing-kmlviewer-in-my-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!