[英]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): 这些是我已经尝试过的东西(当然没有改变):
pod install
again and re-opened the workspace file. pod install
并重新打开工作区文件。 Archive
again. Archive
。 build active architecture only
to Yes ( this thread ) build active architecture only
设置为是( 此线程 ) pod install
again pod install
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.