简体   繁体   中英

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: framework not found Charts

clang: error: linker command failed with exit code 1 (use -v to see invocation)

These are the things I have tried already (no change of course):

  • Re-run pod install again and re-opened the workspace file.
  • Did Clean (clean succeeded) and then try to run Archive again.
  • Set build active architecture only to Yes ( this thread )
  • Removed pod project completely and ran pod install again
  • I even removed pod 'SwiftCharts', '~> 0.3' from the PodFile and its use from the project, but still the error message is the same.

The error messages says:

ld: framework not found Charts

but my PodFile does have this: pod 'SwiftCharts', '~> 0.3'

This is my 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:

ClassA.h:

NSString * const kDriveCameraVideoFlenameExtension = @"mp4";

Then, when I imported this header file

ClassB.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:

static NSString * const kDriveCameraVideoFlenameExtension = @"mp4";

Problem gone, as now the constant belongs to the class and not to the global scope.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM