我试图将swift文件添加到现有的Obj-C项目中,并且该项目有一些链接到它的框架。当我向它添加一个swift文件时,它编译得很好但是在运行时它抱怨一些快速标准类正在链接框架和当前项目中实现。
这些重复的类定义最初不是来自链接框架,而是来自swift标准库,例如 libswiftFoundation.dylib 。任何人都知道如何解决这个问题?。
我正在使用在山脉上运行的xcode8.3。
objc[74652]: Class _TtC8Dispatch16DispatchWorkItem is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftDispatch.dylib (0x101328e58) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100415608). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation20_SwiftNSCharacterSet is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x101456ab0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413708). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation12_DataStorage is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x10145a048) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100419258). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation12_NSSwiftData is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x101456b50) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004137a8). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation25_NSErrorRecoveryAttempter is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x10145a680) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100419888). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation25NSFastEnumerationIterator is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x10145a720) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100419928). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation15NSSimpleCString is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x10145a7d8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004199e0). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtC10Foundation16NSConstantString is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x10145a868) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100419a70). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs18_EmptyArrayStorage is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100e990) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413870). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs20_RawNativeSetStorage is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ea40) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413920). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs17_CocoaSetIterator is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x101023a98) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x10042ed90). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs27_RawNativeDictionaryStorage is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100eb08) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004139e8). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs24_CocoaDictionaryIterator is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x101024a98) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x10042fd90). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs17NonObjectiveCBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x101026538) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100431830). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs17_stdlib_AtomicInt is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x1010289a8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100433ca0). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs19_SwiftNativeNSArray is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ebe0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413ac0). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs24_SwiftNativeNSDictionary is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ec48) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413b28). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs17_SwiftNativeNSSet is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ecb0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413b90). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs24_SwiftNativeNSEnumerator is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ed18) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413bf8). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs18_SwiftNativeNSData is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ed80) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413c60). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs26_SwiftNativeNSCharacterSet is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ede8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413cc8). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs31_stdlib_ReturnAutoreleasedDummy is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ee50) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413d30). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs20_SwiftNativeNSString is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100eec8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413da8). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs19_NSContiguousString is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100ef30) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413e10). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs40_SwiftNativeNSArrayWithContiguousStorage is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100efb0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413e90). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs21_SwiftDeferredNSArray is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f020) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413f00). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs27_ContiguousArrayStorageBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f0b0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100413f90). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs14_VaListBuilder is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10102dec8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004391c0). One of the two will be used. Which one is undefined.
objc[74652]: Class _TtCs13VaListBuilder is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10102dfb8) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004392b0). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftTypePreservingNSNumber is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftFoundation.dylib (0x101456c08) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414028). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSError is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f148) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414078). One of the two will be used. Which one is undefined.
objc[74652]: Class SwiftObject is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f198) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004140c8). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftValue is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f210) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414140). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNull is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f260) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414190). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSArrayBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f2b0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004141e0). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSDictionaryBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f300) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414230). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSSetBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f350) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414280). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSStringBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f3a0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004142d0). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSEnumeratorBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f3f0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414320). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSDataBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f440) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414370). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSCharacterSetBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f490) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x1004143c0). One of the two will be used. Which one is undefined.
objc[74652]: Class _SwiftNativeNSIndexSetBase is implemented in both /Users/username/Dev/Source/build/UninstalledProducts/macosx/BKMySQL.framework/Versions/A/Frameworks/libswiftCore.dylib (0x10100f4e0) and /Users/username/Dev/Source/build/Debug/BKServerFramework (0x100414410). One of the two will be used. Which one is undefined.
Note: BKServerFramework is a command line tool, ignore the name it's not a framework.
答案 0 :(得分:1)
看起来BKServerFramework
与libswiftCore.a
静态关联。它不应该是。
答案 1 :(得分:0)
在命令行工具项目的设置中将SWIFT_FORCE_DYNAMIC_LINK_STDLIB: YES
和SWIFT_FORCE_STATIC_LINK_STDLIB: NO
添加为User-Defined Settings
,以防止BKServerFramework
静态链接到Swift *库