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

My project give me this error, can someone help me please?

Its urgent



Ld /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/InstallationBuildProductsLocation/Applications/FCompas.app/FCompas normal arm64

cd /Users/e5sc/Documents/FCompas

export IPHONEOS_DEPLOYMENT_TARGET=11.3

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/BuildProductsPath/Release-iphoneos -F/Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/BuildProductsPath/Release-iphoneos -filelist /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/IntermediateBuildFilesPath/FCompas.build/Release-iphoneos/FCompas.build/Objects-normal/arm64/FCompas.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=11.3 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/IntermediateBuildFilesPath/FCompas.build/Release-iphoneos/FCompas.build/Objects-normal/arm64/FCompas_lto.o -Xlinker -export_dynamic -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/BuildProductsPath/Release-iphoneos -Xlinker -final_output -Xlinker /Applications/FCompas.app/FCompas -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/IntermediateBuildFilesPath/FCompas.build/Release-iphoneos/FCompas.build/Objects-normal/arm64/FCompas.swiftmodule -Xlinker -dependency_info -Xlinker /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/IntermediateBuildFilesPath/FCompas.build/Release-iphoneos/FCompas.build/Objects-normal/arm64/FCompas_dependency_info.dat -o /Users/e5sc/Library/Developer/Xcode/DerivedData/FCompas-bacxfpawxaqlskegqvmceactrbcp/Build/Intermediates.noindex/ArchiveIntermediates/FCompas/InstallationBuildProductsLocation/Applications/FCompas.app/FCompas


ld: entry point (_main) undefined. for architecture arm64

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

Looking at that build transcript it seems that you’re building a vanilla iOS app using Swift. If so, the error reported:

ld: entry point (_main) undefined. for architecture arm64

is pretty clear: There’s a problem with your

main
function, that is, the entry point to your app.

There’s two two ways you can set the

main
function in Swift:
  • The standard approach is to add the

    @UIApplicationMain
    attribute to your app delegate class. For example:
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
        …
    }

    .

  • If you need to customise the

    main
    function you can remove that attribute and add a
    main.swift
    file to your project (and have it call
    UIApplicationMain
    ).

I suspect you were shooting for the first approach, and thus you should check that your app delegate has the

@UIApplicationMain
attribute.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
error: linker command failed with exit code 1 (use -v to see invocation)
 
 
Q