Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

前端 未结 25 1235
一生所求
一生所求 2020-11-28 04:28

I can\'t get rid of this error!

I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data fo

25条回答
  •  眼角桃花
    2020-11-28 05:05

    It seems like the issue is different for most of us, and the error message has decent info. In my case, the Deployment Target was set to 10.13 by the export MACOSX_DEPLOYMENT_TARGET=10.13 line, but I was running 10.14. So I had to switch my Deployment Target to 10.14 in General > Deployment Info, in order for the ITLibrary-related symbols to be available again.

    cd /Users/foo/src/scrobble/macos/itunes-scrobble
        export MACOSX_DEPLOYMENT_TARGET=10.13
    
    ... SNIP ...
    
    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_ITLibMediaItem", referenced from:
          objc-class-ref in AppDelegate.o
      "_OBJC_CLASS_$_ITLibPlaylist", referenced from:
          objc-class-ref in AppDelegate.o
      "_OBJC_CLASS_$_ITLibrary", referenced from:
          objc-class-ref in AppDelegate.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

提交回复
热议问题