ld:找不到用于 -lAFNetworking xcode 的库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40472440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:33:55  来源:igfitidea点击:

ld: library not found for -lAFNetworking xcode

iosxcodecocoapodsafnetworking

提问by c00der

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:

我是 ios 编程的新手。克隆了一个朋友项目。尝试构建时(在解决了很多其他错误之后),我收到以下错误:

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.

我查看了Pod文件,在项目中搜索了AFNetworking,就在那里。不知道出了什么问题。

采纳答案by little

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.
  1. 您会在 Pods 目录中看到 AFNetworking。
  2. 您的 Pods 目录位于搜索路径中。转到项目 -> 构建设置 -> 搜索“搜索路径”并确保您的 Pods 目录在那里。例如,您可以通过添加“${PROJECT_DIR}/Pods”来添加它。

回答by t.ios

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

还要确保您正在运行 .xcworkspace 项目(白色图标),而不是 .xcodeproj 项目(蓝色图标)

green box == .xcworkspace project

绿框 == .xcworkspace 项目

回答by Zero.D.Saber

add $(inherited)flag to LIBRARY_SEARCH_PATHSat build settingsin Xcode target.

在 Xcode 目标中添加$(inherited)标志到LIBRARY_SEARCH_PATHSat build settings

回答by msk_sureshkumar

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

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

回答by aftab muhammed khan

please try to install COCOAPOD app in your mac.

请尝试在您的 Mac 中安装 COCOAPOD 应用程序。

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

尝试重新附加 AFNetworking这里是链接,请按照说明操作