简体   繁体   English

铛:错误:链接器命令失败,退出代码为1,Xcode链接器错误

[英]clang: error: linker command failed with exit code 1, Xcode Linker Error

I am getting this error when I try to Build the app or even try to run in on a real phone or do Product > Archive. 当我尝试构建应用程序,甚至尝试在真实手机上运行或执行产品>存档时,出现此错误。

ld: warning: directory not found for option '-F/Users/mycomputer/Google Drive/PROJECTS/MyProject/code/MyProject/build/Debug-iphoneos' ld:警告:找不到选项'-F / Users / mycomputer / Google Drive / PROJECTS / MyProject / code / MyProject / build / Debug-iphoneos'的目录

ld: framework not found Charts ld:找不到框架图表

clang: error: linker command failed with exit code 1 (use -v to see invocation) clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

These are the things I have tried already (no change of course): 这些是我已经尝试过的东西(当然没有改变):

  • Re-run pod install again and re-opened the workspace file. 再次重新运行pod install并重新打开工作区文件。
  • Did Clean (clean succeeded) and then try to run Archive again. 进行了清理(清理成功),然后再次尝试运行Archive
  • Set build active architecture only to Yes ( this thread ) build active architecture only设置为是( 此线程
  • Removed pod project completely and ran pod install again 完全删除了pod项目,然后再次运行pod install
  • I even removed pod 'SwiftCharts', '~> 0.3' from the PodFile and its use from the project, but still the error message is the same. 我什至从pod 'SwiftCharts', '~> 0.3'删除了pod 'SwiftCharts', '~> 0.3'及其在项目中的使用,但错误消息仍然相同。

The error messages says: 错误消息显示:

ld: framework not found Charts ld:找不到框架图表

but my PodFile does have this: pod 'SwiftCharts', '~> 0.3' 但是我的PodFile确实有这个: pod 'SwiftCharts', '~> 0.3'

This is my PodFile : 这是我的PodFile

# Uncomment this line to define a global platform for your project
platform :ios, “9.0”

use_frameworks!
pod 'Parse'
pod 'ParseUI'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'JSQMessagesViewController'
pod 'SwiftCharts', '~> 0.3'


target 'ShitTalk' do

end

target 'ShitTalkTests' do

end

target 'ShitTalkUITests' do

end

What else can I try? 我还能尝试什么?

In my case the problem was I defined a const in a header file: 就我而言,问题是我在头文件中定义了一个const:

ClassA.h: Class.h:

NSString * const kDriveCameraVideoFlenameExtension = @"mp4";

Then, when I imported this header file 然后,当我导入此头文件时

ClassB.m: B.m:

#import ClassA.h

The linker crashed with this error. 链接器因此错误而崩溃。 Luckily I'm old enough to know some C. To solve this issue all I had to do is change the scope of the constant by making it static: 幸运的是,我已经足够大了一些C语言。要解决此问题,我要做的就是通过将其设为静态来更改常量的范围:

static NSString * const kDriveCameraVideoFlenameExtension = @"mp4";

Problem gone, as now the constant belongs to the class and not to the global scope. 问题消失了,因为现在常量属于类而不是全局范围。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Unity,Xcode和Clang:错误:链接器命令失败,退出代码为1 - Unity, Xcode and clang: error: linker command failed with exit code 1 链接器命令失败,退出代码1 clang:错误 - linker command failed with exit code 1 clang:error xcode中的错误:clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - error in xcode : clang: error: linker command failed with exit code 1 (use -v to see invocation) 铛:错误:链接器命令失败,退出代码为1 [Jenkins] - clang: error: linker command failed with exit code 1 [ Jenkins ] 铛:错误:链接器命令失败,退出代码1仅在设备上出现 - clang: error: linker command failed with exit code 1 coming only on device clang:错误:链接器命令失败,退出代码为1,react-native - clang: error: linker command failed with exit code 1, react-native 铛:错误:链接器命令失败,退出代码为1 iOS9 - clang: error: linker command failed with exit code 1 iOS9 clang:错误:归档时链接器命令失败,退出代码为1 - clang: error: linker command failed with exit code 1 when archiving Xcode 5- clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Xcode 5- clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode clang:错误:链接器命令失败,退出代码为 1(UNITY 用于创建) - Xcode clang: error: linker command failed with exit code 1 (UNITY used for creation)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM