Linking Errors while integrating SKMaps.Framework - ios

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.

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.

Faced with the same problem. Deleting -all_load flag did not help, so I continued to research and found a solution:
Despite the fact that Skobbler declares the need for linking the libc++ library, in reality you need to link libstdc++.6 library. Note that linking libstdc++ will not help.
P.S. Xcode 6.4, iOS SDK 8.4

Related

Why can't I get rid of libstdc++?

Since upgrading to xcode 10 beta 6 I'm getting the error
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know that libstdc++ has been removed from the iOS simulator but the project and all the targets have C++ Standard Library set to libc++, not libstdc++.
The project has nothing set in Other Linker Flags. The summary of the Other Links Flags for the target includes -stdlib=libstdc++
but when I double-click on it to edit it, it isn't in the list.
What is it that's sneaking libstdc++ in? Any help would be greatly appreciated!
It turned out the problem was that one of my dependencies was using libstdc++, so Cocoapods was adding the -stdlib=libstdc++ to the linker flags for the project.
The solution was to update the dependency to a newer version that had been built against libc++.
If anyone else has trouble identifying which dependency is using libstdc++ then I recommend removing $(inherited) from your target's linker flags. That will cause the linker to report missing symbols from the place that's using it, giving away which library has the problem.

GCM Library errors: Integration GCM in iOS Swift

What I have done after 2 days of reading stack overflow:
Keywords to problem: "Apple-Mach-O Linker Error", "libGcmLib.a(GCMRmqManager.o)", sqlite3", "GCMRmq2PersistentStore"
Installed latest pod.
Tested 'Other Linker Flags' -ObJC and empty as well.
Cleaned the project and rebuilt. Deleted project and recreated, no help. Header is in the right path and properly configured.
Manually copied dependencies but it didn't help.
Manually copied new source code from Google's Github as well as their recently updated 'GCM Playground', nothing worked.
Integrated CoreData.framework to no avail.
Tried these solutions:
Apple Mach-O Linker Error when compiling for device,
CocoaPods adds incorrect Other Linker Flags, Google Cloud Messaging Bridging Header import fails, Xcode - symbol(s) not found for architecture x86_64 (iOS Lib), Undefined symbols for architecture arm64, Apple Mach-O-Linker Error CocoaPods, Swift iOS don't recognize GCM library imports?
So I am stuck. How do I solve the problem(s) displayed in the image below: "sqlite3.... ", referenced from: "GCMRmq2PersistentStore in libGcmLib.a(GCMRmqManager.o)?
IMAGE
GCM seems to be using sqlite3 in the library. You should link your app against it to build it. You tried integrating CoreData but it should rather have been sqlite3.
You should also check CocoaPod's generated xcconfig file i.e. Pods/Target Support Files/Pods/Pods.debug.xcconfig file and the OTHER_LDFLAGS option should have -l"sqlite3" in it. That should have linked it for you.

Xcode - Missing Architecture (library linking)

For the recent couple of days I have had this compiler error in Xcode every time I've built my project:
ld: warning: ignoring file /.../(Framework Name).framework/(Framework), missing required architecture x86_64 in file /.../(Framework Name).framework/(Framework) (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CLSNAME", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also can't run this code on the iPhone 5 simulator (i386).
The iPhone device I have is outdated and can't run iOS 8. I tried setting the build settings to iOS 7 but I get an error regarding the lack of support for dynamic libraries before iOS 8.
Things to note:
I am using 2 projects, in 2 different workspaces. (one for the library and one for the demo app. Tests of the same code with the unit tests in the library project are successful.)
I used to be able to link the demo project with the library project until I had to do some changes in the library code. After I exported the newer version this error started occurring.
In order to get the library file/folder (.framework) I used the Archive option.
Running lipo -info outputs Architectures in the fat file: lib.a armv7 arm64
I have C++ code in the library project (unlikely to be the issue)
In the library project, I am using another external library I installed with Cocoa Pods (also used to work before changes in the library code)
Solutions I tried:
Changing the Architectures and the Valid Architectures list in Build Settings.
Setting "Build Active Architecture Only" to "No" in Build Settings.
Creating a new project (both for the demo and the library)
Making the library a static library (new project, got the same warning, no error, couldn't #import the files I needed)
I only started working with iOS and Xcode a couple of months ago and I am not super-experienced with everything there yet, so please try to explain everything with as much detail as you can.
Thanks in advance to anyone trying to help :)
Did you add the framework it says is missing? Also, try to delete the Derived Data folder and then clean the project. If that does not work, then turn off Modules in build settings.

Venmo touch Braintree payment - compile error: Undefined symbols for architecture i386: "_OBJC_CLASS_$_VTClient"

I have successfully installed braintree ios sdk using cocoapod and It was compiled fine.
However, when I initVTClient in my appdelegate.m file. I was getting compiling error:
Undefined symbols for architecture i386:
"OBJCCLASS_$_VTClient", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and I couldn't find any solutions online at all. any tips?
also submitted an issue here:
https://github.com/braintree/braintree_ios/issues/27
It's possible that you need to put "build settings"->architectures back to "standard architectures" since the old Venmo library (before their big v0 update) was built before the 64bit architecture. That's one solution I've seen.
[EDITED: 2/25/2014, 4:47pm EST]
I got my project to work. The problem for me was that my existing build settings were getting in the way of the build settings that cocoapods wanted to load onto the project. Those are the important ones such as the Venmo Framework, so there's good reason for the issue.
If you go to "build settings" -> "other linker flags", and add a new flag: "$(inherited)", it will work. I put that one at the top of the list so I'd try the same, not sure if order matters. What this does is keeps your old settings / flags, (I was using -ObjC), and imports the new ones from cocoapods. Good luck.
looks like i need to add VenmoTouch.framework into my target->Link Binary with Libraries.
then what's the point of using cocoapods
the official answer:
https://github.com/braintree/braintree_ios/issues/27
Make sure you verify which target CocoaPods is integrating with. There are a number of patterns for specifying this, such as target "name" do ... end and link_with.
See here for more details: http://guides.cocoapods.org/syntax/podfile.html#link_with

Undefined symbols in Xcode

I'm getting this error when building in Xcode for iOS.
Undefined symbols for architecture i386:
"_CGRectInset", referenced from:
-[RootViewController viewDidLoad] in RootViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The app is a clean project, just built from the template Xcode provides.
Any ideas?
I had the same problem with a project created from "Page-Based Application" template, in XCode4 Developer Preview 5.
You can fix it by adding the CoreGraphics framework to the list of linked frameworks and libraries. In other words:
Select the project file in the navigator (left-pane)
select the app target (the only other one is a testing target)
In the summary tab, scroll down to "Linked Frameworks and Libraries"
Hit the + andd CoreGraphics.framework.
Then it builds and runs.
This may be due to the project not being linked to the correct libraries. It may also be that there are missing Frameworks on your SDK installation. In the Build Phases section, make sure that your app is linking with UIKit and CoreGraphics. Also, it may help to also add the QuartzCore Framework, although I doubt that that is needed.

Resources