ios - clang : error: linker command failed with exit code 1, 仅在设备上测试时

标签 ios linker

当我遇到这个问题时,正要在设备上测试我的应用程序,我收到了这个链接器错误。 我已经检查了我所有的编译源和构建阶段,但没有迹象表明我导入了两次。

ld: duplicate symbol _calculateNextSearchPage in /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) and /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

这只会在设备上进行测试时发生,而不会在模拟器中发生。

最佳答案

好的,我遇到了同样的问题。好像我修好了。 我正在使用 cocapods,因此无法正确执行所描述的标准程序。

使用 Cocoapods 正确添加 FastPDFKit 的步骤。

  • 下载 FastPDFKit
  • 在您的项目中将文件添加到“您的项目”
  • 转到刚刚下载的 FastPDFKit 文件夹
  • 找到 1 个文件夹和 1 个项目文件。按住 Command 键并将它们添加到您的项目中
  • FastPdfKit.xcodeproj
  • FastPdfKit.embeddedframework

enter image description here

(注意:FastPdfKit.embeddedframework 是实际的框架,您 可能想在添加之前独立打开 FastPdfKit.xcodeproj 到您的项目,从中删除 FastPdfKit.embeddedframework 文件夹 您的磁盘和项目中的 Build FastPdfKit 目标。你应该看到 新建FastPdfKit.embeddedframework文件夹)

  • 转到您的项目设置 > 您的目标 > 构建阶段 > 将二进制文件与库链接
  • 确保 FastPdfKit.framework 存在。
  • 如果没有,请将其从项目中拖放到那里。
  • 清理项目,删除派生数据
  • 添加#import <FastPdfKit/FastPdfKit.h>在您需要它的地方,您很高兴去。
  • 这是我的库链接二进制文件的样子

    enter image description here

如果您有任何问题,请告诉我我可能遗漏了什么。

关于ios - clang : error: linker command failed with exit code 1, 仅在设备上测试时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10943121/

相关文章:

html - Safari 中的导航栏堆栈

ios - 弄清楚 iOS 模拟器崩溃报告

c - 弱链接的可移植性如何? #pragma weak my_symbol

Django + Pydev/Eclipse + Google App Engine - 可能吗?

ios - 如何在 iOS 应用程序中包含全屏图像

ios - 快速安全地保存敏感数据

ios - 如何获取 UIViewController 的标题 UILabel

c++ - Visual Studio 2010 中的 FFTW

c - 将 C 程序与标准线程(C11 中的 <threads.h>)链接的正确方法是什么?

c++ - 如何在 Visual C++ 中手动修改名称?