Swift链接器错误无法找出问题所在

时间:2019-03-13 21:06:31

标签: swift macos linker-errors

Swift链接器错误无法找出问题所在,以及问题是我的Swift还是我的代码:

error

Ld /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Products/Debug/lab3 normal x86_64 (in target: lab3)
    cd /Users/zachadams/Desktop/ios/lab3
    export MACOSX_DEPLOYMENT_TARGET=10.13
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Products/Debug -F/Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Products/Debug -filelist /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Intermediates.noindex/lab3.build/Debug/lab3.build/Objects-normal/x86_64/lab3.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -Xlinker -rpath -Xlinker @loader_path/../Frameworks -mmacosx-version-min=10.13 -Xlinker -object_path_lto -Xlinker /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Intermediates.noindex/lab3.build/Debug/lab3.build/Objects-normal/x86_64/lab3_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift_static/macosx -Xlinker -force_load_swift_libs -lc++ -framework Foundation -Xlinker -add_ast_path -Xlinker /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Intermediates.noindex/lab3.build/Debug/lab3.build/Objects-normal/x86_64/lab3.swiftmodule -Xlinker -dependency_info -Xlinker /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Intermediates.noindex/lab3.build/Debug/lab3.build/Objects-normal/x86_64/lab3_dependency_info.dat -o /Users/zachadams/Library/Developer/Xcode/DerivedData/lab3-empqvklyixnvjqfpmxfjnrlvhmyd/Build/Products/Debug/lab3

Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
     (maybe you meant: _$S8Dispatch23dispatch_get_main_queueSo03OS_b1_E0CyF)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

0 个答案:

没有答案