Xcode Apple Mach-O Linker Error 1
Asked Answered
H

2

10

after renaming my project whenever I try to build the app I get an Apple Mach-O Linker Error below is the output from Xcode itself

Ld /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/Broadcast!Tests.xctest/Broadcast!Tests normal x86_64
    cd "/Users/joshevans/Desktop/sn app/SwifferApp"
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk
-L/Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator
-F/Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks
-filelist /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast!Tests.LinkFileList
-Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -bundle_loader /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/SwifferApp.app/SwifferApp
-Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
-Xlinker -add_ast_path -Xlinker /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast_Tests.swiftmodule
-mios-simulator-version-min=8.0 -Xlinker -dependency_info -Xlinker /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast!Tests_dependency_info.dat
-o /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/Broadcast!Tests.xctest/Broadcast!Tests ld: file not found: /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/SwifferApp.app/SwifferApp clang: error: linker command failed with exit code 1 (use -v to see invocation)

thanks for your help, as I'm new to Xcode and the swift language. Josh

Heckelphone answered 31/10, 2014 at 0:12 Comment(6)
Clang recommends to use -v to see invocation. Have you tried that?Materialist
I'm new to Xcode, what would be the best way to go about doing that?Heckelphone
Does your project name contain an exclamation mark?Artifice
Yes the product name is Broadcast! And the bundle identifier is com.wasd.broadcast- could that be causing this issue?Heckelphone
I've renamed the project again missing out the exclamation mark however still no luck and the same error is given out upon buildingHeckelphone
@josh2205 How do we change project name?Croissant
C
34

After rename just go to your project file ( Where you will see tabs : General, Capabilities, Info etc)

And choose YourAppTests in the list of the left side

enter image description here

You probably will see this picture enter image description here

Set Host Application to your project name and that's it.

Christal answered 10/11, 2014 at 16:19 Comment(3)
Thank you so much! I have no idea how it got into this state.Iselaisenberg
Life saver! After renaming I had this and changing as per your instructions worked perfectly! Thank you very much. Mine was set to custom on xcode 6 and changed to the new name - perfect.Tempietempla
Our Father in heaven, hallowed be your name. Your kingdom come, your will be done, on earth, as it is in heaven. Bless this mutant_america for his excellent answer on this problem. Amen.Zuniga
U
0

I occasionally got Apple Mach-O Linker Error 1 while trying to implement AdMob Ads. The way I dealt with it was by first going into my app's build settings and locating "library search paths" and clearing all of the search paths. I then re-added the AdMob folder to the project, and the error disappeared.

Now obviously your situation is a little different. Personally, I would rename the file back to its previous name. If the error still persists, then clear the library search paths. Still an error? What I did when I kept receiving the error was create a new Xcode project with the name I want, and then copy all of the files into the new project. It's a simple process, especially if you're a beginner, it probably won't take too long. I hope this helps!

Upwards answered 6/11, 2014 at 23:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.