Naveen Kumar
Naveen Kumar

Reputation: 177

Apple Mach-O Linker Error in xcode 6

I was adding new UITableView delegate method in my code and suddenly i got one error while compiling like this .My Xcode version is Version 6.1 (6A1046a)

Ld /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos/MedTests.xctest/MedTests normal arm64
    cd /Users/apple/Documents/med
    export IPHONEOS_DEPLOYMENT_TARGET=8.1
    export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -bundle -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos -F/Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos -F/Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/Developer/Library/Frameworks -filelist /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Intermediates/Med.build/Debug-iphoneos/MedTests.build/Objects-normal/arm64/MedTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -bundle_loader /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos/Med.app/Med -framework XCTest -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=8.1 -Xlinker -dependency_info -Xlinker /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Intermediates/Med.build/Debug-iphoneos/MedTests.build/Objects-normal/arm64/MedTests_dependency_info.dat -o /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos/MedTests.xctest/MedTests

ld: file not found: /Users/apple/Library/Developer/Xcode/DerivedData/Med-emhoezxvdfnzwvfvktteeafyndtq/Build/Products/Debug-iphoneos/Med.app/Med
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have tried my backup versions too but none of them are working now,please help me

Upvotes: 4

Views: 16857

Answers (6)

Andy Dong
Andy Dong

Reputation: 415

Go to Project -- > Build Settings --> Testing --> Test Host Remove the paths in Test host.

Upvotes: 2

Crashalot
Crashalot

Reputation: 34513

Cleaning and running the project again can also work.

1) Product -> Clean 2) Product -> Run

No clue why, but it worked.

Upvotes: 2

Ben Thielker
Ben Thielker

Reputation: 4164

I just encountered "Apple Mach-O Linker Error" when referring to a ViewController's view as _view instead of self.view.

Upvotes: 0

RickJansen
RickJansen

Reputation: 1713

Was completely stuck with this too. Deleting the derived data did not help, nor cleaning the build folder (Product -> option-key -> clean build folder), nor deleting stuff in the Organizer window. In the end I decided to delete the "myproductTests" target (that I never even looked into). That worked. (Xcode 6.1.1 and 6.3)

Upvotes: 6

Erik Johansson
Erik Johansson

Reputation: 1248

Deleting your Derived data folder might also help

You'll find it in

Window -> Organizer -> Projects (Then select your project)

Upvotes: 0

Puvanarajan
Puvanarajan

Reputation: 2906

I am also had these kind of issue. Then I create the new schema. Then it worked. Just try.

Change the schema or create new schema enter image description here

Upvotes: 19

Related Questions