clang: error: linker command failed with exit code 1 (use -v to see invocation) when setting up cocoapods environment - ios

I am setting the cocoapods dependency management tool for iOS project, when building my project i got this error:
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Xcode 4.5 and Mac OS X Lion 10.7.4. Thanx in advance.

Can't comment yet, so posting as an answer.
It would help to have a bit more information on what you did to setup cocoapods, library settings in XCode and whether this is your first time using cocoapods or if the issue suddenly started. Try to give us a good idea of the details of your current situation.
For the time being, a little googling popped up this URL: https://github.com/CocoaPods/CocoaPods/issues/155
You might find it helpful, specifically the post near the bottom:
In my environment the issue was that the Pods project did not have a
target called ADHOC (as per the main project). I duplicated the Pods
release target, called it ADHOC, changed the OS Deployment Target to
my requirement (5.0) and then everything worked.

Related

iOS firebase Mach-O Linker Error without cocapods

I'm trying to import Firebase into my iOS app. I followed this tutorial for doing this manually with Objective-C (as opposed to using CocoaPods).
http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/
When I try to build my project, I get the following errors:
"Apple Mach-O Linker Error"
"Linker command failed with exit code 1 (use -v to see invocation)"
I'm familiar with the Linux CLI (less so with Macs), but I don't understand how to apply the -v flag to XCode's build process to get more info.
I've been Googling this for the last 3 hours, but every answer I find seems to be directed at users who weren't using an XCode workspace with CocoaPods.
I don't have CocoaPods installed, so I don't think this is my issue. Despite that I have converted my project and properly imported it into an XCode workspace, this still didn't solve my problem.
My app is a Swift project, and I have imported the modulemap, firebase.h, and googleServices.plist files.
I've also made my Header and Library search paths recursive for the entire project folder in an attempt to fix this.
Here's my project navigation. Although at this point I suspect it's some kind of build setting that isn't correct.
Some selected answers I've tried to apply without success:
Apple Mach -O Linker command failed
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
Framework not found GoogleToolboxForMac
Adding system header search path to Xcode
https://github.com/firebase/firebase-ios-sdk/issues/258
Apple Mach-O Linker & Ditto Error - Xcode 8
https://github.com/invertase/react-native-firebase/issues/198
https://forum.ionicframework.com/t/ios-xcode-8-apple-mach-o-linker-ld-error-group-in-xcode/89903
Upgrading to xcode 9.2 fixes this. It appears to be an issue with earlier versions not properly handling linking.
Which is misleading b/c the firebase documentation indicates it's compatible with xcode 8. But I think that's assuming you use cocoapods. If you don't, and instead try to link the obj-c frameworks you need xcode 9+
Once I knew how to examine the more verbose linking error, googling for x86_64 led me to some helpful answers.
This and other answers helped me investigate upgrading.
ld: framework not found Stripe for architecture x86_64

Build failing, Parse-Server/Pod/Bolts

I'm using Parse-Server/Heroku and just installed the pod for Parse in an iOS project of mine (written in objective C).
I am using Xcode Version 9.2 and pod version 1.3.1.
The macOS is High Sierra Version 10.13.2.
When I try to build the project, I get this error:
ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
But Bolts seems to be installed, as a dependency when I run pod install.
Any idea about what I can do to solve the problem?
I presume the information I am giving here may not be enough. If more is needed to solve the issue please let me know what I should provide.
If you're using cocoapods, make sure you're opening the generated workspace and not the project itself.

objective-c linker error with OAuth2 library

I'm getting this error when I try to build my project in Xcode:
ld: library not found for -lGTMOAuth2 clang:
error: linker command
failed with exit code 1 (use -v to see invocation)
And we're using pods, so I opened the workspace, not the project.
I just got Xcode version 8.3.3, so not sure if this is causing any errors...
Turns out OAuth2 was not included in the Pod File, and I didn't check because I thought it was there before I pulled the latest version of the app. Thanks John Tracid.

Chartboost with Unity 5 on xcode missing linking file

Has anybody used chatboost with unity 5 on IOS? I get a linking error and a warning
warning: directory not found for option '-L/Users/alexm/Downloads/iosFree/LibrariesPlugins/iOS'
ld: library not found for -lChartboost
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On the Android everything is fine. Do I have to do anything extra other what i mentioned on chartboost integration page?
Make sure that if the Chartboost plugin is using some PostprocessBuildPlayer stuff, that is isn't getting clobbered by a different script.
If, in XCode, you check the build phases tab for linked frameworks and you don't see Chartboost.framework, it's likely the build script not running correctly.

Library not found for lgcov

I'm using Xcode 4.6 and I've been writing some Unit Tests for an iOS app. I've tried to do some code coverage following from this tutorial: http://supermegaultragroovy.com/2005/11/03/unit-testing-and-code-coverage-with-xcode/ .
I've followed the 3 steps for my AppTests Target:
Check “Generate Test Coverage Files”
Check “Instrument Program Flow”
Add “-lgcov” to “Other Linker Flags”
The problem is that if I hit "Test" I get this error:
ld: library not found for -lgcov
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this?
I think it's caused by your xcode version. Apple remove the library code-coverage needed after xcode 4.3. You need to add one file to your project manually. You can see check this blog for more details: http://www.gerardcondon.com/blog/2012/02/21/code-coverage-updates-for-xcode-4-dot-3/
You can try this. I tried but failed since my project include C++ code. I think that's because xcode 4.6 has not supported this feature...

Resources