Apple Mach-O Linker Error in xcode 6

16.8k views Asked by At

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

6

There are 6 answers

2
Puvanarajan On BEST ANSWER

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

0
Erik Johansson On

Deleting your Derived data folder might also help

You'll find it in

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

0
Andy Dong On

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

0
Crashalot On

Cleaning and running the project again can also work.

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

No clue why, but it worked.

4
RickJansen On

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)

0
Ben Thielker On

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