macOS Command Line Tool with Swift Cocoa Framework: Library not loaded

后端 未结 3 855
长发绾君心
长发绾君心 2020-12-28 13:05

The following error is thrown when trying to run my target:

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: x/Xcode/DerivedData/x/Buil         


        
3条回答
  •  天命终不由人
    2020-12-28 13:59

    Swift Package Manager sets the following, which resolved this issue for me in another project:

    SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES
    SWIFT_FORCE_STATIC_LINK_STDLIB = NO
    

    Note that the search path was set to:

    LD_RUNPATH_SEARCH_PATHS = $(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path
    

提交回复
热议问题