Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode library not found

Tags:

xcode

I'm getting the following error:

ld: library not found for -lGoogleAnalytics clang: error: linker command failed with exit code 1 (use -v to see invokation)

I've spent some time googling but can't find how to fix this problem. I'm new to xcode and this is an existing project that I need to work on.

like image 215
SBel Avatar asked Jul 06 '12 08:07

SBel


People also ask

How do I fix Xcode file not found?

Delete the files from the xcode project navigator (only deleting references). Add them again to the project (dragging from finder into the project navigator).

Where is my Xcode library?

At the bottom of the left sidebar, in the “Filter” box, type “Libraries”. If, in the Project Navigator, you now see a yellow folder icon with the word “Libraries” next to it, then you have found the Libraries folder you are looking for.

What is Xcode library?

The Xcode Library is an easy way for you to discover available SwiftUI views and drag and drop them to the Xcode Previews canvas, enabling rich visual editing of your app.


2 Answers

You need to set the "linker search paths" of the project (for both Debug and Release builds). If this library was in, say, a sibling directory to the project then you can set it like this:

$(PROJECT_DIR)/../GoogleAnalytics/lib

(you want to avoid using an absolute path, instead keep the library directory relative to the project).

like image 112
trojanfoe Avatar answered Sep 26 '22 09:09

trojanfoe


In my case, the project uses CocoaPods. And some files are missing from my project.

So I install it from CocoaPods: https://cocoapods.org/.

And if the project uses CocoaPods we've to be aware to always open the .xcworkspace folder instead of the .xcodeproj folder in the Xcode.

like image 21
Aniruddha Shevle Avatar answered Sep 22 '22 09:09

Aniruddha Shevle