Search code examples
iosswiftxcode6skmaps

Linking Errors while integrating SKMaps.Framework


Getting these error while trying to integrate SKMaps framework

Undefined symbols for architecture x86_64:

  "CRouteTestManager::calculateRoute(NGRouteInput const&, std::__1::shared_ptr<CRoute>&)", referenced from:

      PoiTrackerTest::createRoute() in SKMaps(PoiTrackerTest.o)

  "_gpTestRoutesManager", referenced from:

      PoiTrackerTest::createRoute() in SKMaps(PoiTrackerTest.o)
      createNavigationObject(int) in SKMaps(NavigationTest.o)


ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help me resolve this error.

Environment :
Xcode 6.3.1, Mac OSX 10.10.3
Deployment Target iOS7.0

Supports Swift.

i was following this guide : http://developer.skobbler.com/getting-started/ios

and also added CoreMotion.framework as there were also linking errors related to that framework.


Solution

  • Cause of Linker Error

    This appears to be the result of the linker flag -all_load, which may have been added to your project through a CocoaPod. In the rare case that you have a static library with nothing but categories defined then you need this flag. Otherwise, it can be safely removed from your build. See discussion here:

    What does the -all_load linker flag do?

    From a link in the comments section on that discussion you can see that this bug that previously required -all_load has been fixed since XCode 4.

    Objective-C categories in static library

    Probable Explanation

    This framework has a bunch of tests defined inside, but their dependencies are not included in the framework. When the linker is forced to resolve and link all dependencies, it errors out because it cannot find them. Basically, the library should be cleaned up so that it doesn't contain these unnecessary symbols. The work around is to remove -all_load for the time being.