Xcode clang error when adding SDWebImage framework
Asked Answered
S

2

0

I am trying to compile an app that use SDWebImage, when I add the framework to xCode I keep getting the following error.

I have attempted to add the framework by clone the git repo

ld: framework not found SDWebImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Switch answered 30/8, 2015 at 0:57 Comment(2)
Have you added the files to the Build?Dasilva
@Dasilva I believe so, see above screen shotSwitch
H
1

Linking in Xcode requires a bit of work. We can tell what to do or suggest a better way. As I consider "dropping framework" solution a very bad habit, I'd strongly suggest a better way:

Use dependency manager!

This will help you to see whenever your dependencies get new updates. You'll also know which version are you using. This is a good practice.

You can eg use Cocoapods. Go to your Terminal, type:

$ sudo gem install cocoapods

Then go to your project folder (place, where you have xcodeproj) and type:

$ pod init

This creates a file named Podfile. Open it and paste:

platform :ios, '8.0' // or whatever you need
use_frameworks!

pod 'SDWebImage', '~> 3.7'

So when you have it ready, open Terminal and type:

$ pod install

From now you should work on xcworkspace instead od xcodeproj. Your dependency should work correctly.

BTW: There are many other solutions. You can simply use git submodules. You can also use Carthage. However most popular and as for me atm most convenient way is Cocoapods, so I wrote steps for this way.

Hampstead answered 30/8, 2015 at 9:32 Comment(0)
Z
0

You've added SDWebImage as a linked framework.

What you should be doing is adding it as an Embedded framework, and make sure that your build phase copies the framework into your app bundle.

Zaid answered 30/8, 2015 at 9:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.