Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: library not found for -lAFNetworking xcode

I am a total newbie to ios programming. Cloned a friends project. When trying to build (after resolving a lot of other errors), I get the following error:

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

I checked the Pod file and searched for AFNetworking in the project, and it is there. Don't know what is going wrong.

like image 625
c00der Avatar asked Nov 07 '16 18:11

c00der


5 Answers

also make sure you are running the .xcworkspace project (white icon),not the .xcodeproj project (blue icon)

green box == .xcworkspace project

like image 127
t.ios Avatar answered Oct 13 '22 07:10

t.ios


The error message indicates that the library was not found.

Make sure that:

  1. You see the AFNetworking in your Pods directory.
  2. Your Pods directory is in the search paths. Go to the project -> Build Settings -> Search for 'search paths' and make sure that your Pods directory is there. You can add it by adding "${PROJECT_DIR}/Pods" for example.
like image 39
little Avatar answered Oct 13 '22 07:10

little


add $(inherited) flag to LIBRARY_SEARCH_PATHS at build settings in Xcode target.

like image 26
Zero.D.Saber Avatar answered Oct 13 '22 06:10

Zero.D.Saber


1.Remove Path from Other Linker flags 2.Clean the build 3.Run the code

like image 32
msk_sureshkumar Avatar answered Oct 13 '22 06:10

msk_sureshkumar


please try to install COCOAPOD app in your mac.

Try to re attached AFNetworking here is the link please follow the instruction

like image 2
AFTAB MUHAMMED KHAN Avatar answered Oct 13 '22 06:10

AFTAB MUHAMMED KHAN