Введение Swift в OC Project вызывает ошибку компиляции - PullRequest
0 голосов
/ 30 мая 2018

Проект OC, это xcworkspace, содержащий номер sub-xcodeproj, я изменяю код в sub-xcodeproj, я создал объект Swift в sub-xcodeproj и нажимаю подсказки Xcode, чтобы добавить Bridging-Заголовочный файл, скомпилировал следующую ошибку.Как мне решить эту ошибку компиляции?

Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftMetal", referenced from:
      __swift_FORCE_LOAD_$_swiftMetal_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftMetal_$_Business)
  "__swift_FORCE_LOAD_$_swiftQuartzCore", referenced from:
      __swift_FORCE_LOAD_$_swiftQuartzCore_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftQuartzCore_$_Business)
  "__swift_FORCE_LOAD_$_swiftDispatch", referenced from:
      __swift_FORCE_LOAD_$_swiftDispatch_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftDispatch_$_Business)
  "__swift_FORCE_LOAD_$_swiftCoreFoundation", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreFoundation_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreFoundation_$_Business)
  "__swift_slowAlloc", referenced from:
      _swift_rt_swift_slowAlloc in libBusiness.a(TestSwift.o)
  "__swift_FORCE_LOAD_$_swiftCoreGraphics", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreGraphics_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreGraphics_$_Business)
  "__swift_FORCE_LOAD_$_swiftFoundation", referenced from:
      __swift_FORCE_LOAD_$_swiftFoundation_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftFoundation_$_Business)
  "__swift_FORCE_LOAD_$_swiftDarwin", referenced from:
      __swift_FORCE_LOAD_$_swiftDarwin_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftDarwin_$_Business)
  "__swift_FORCE_LOAD_$_swiftUIKit", referenced from:
      __swift_FORCE_LOAD_$_swiftUIKit_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftUIKit_$_Business)
  "__swift_FORCE_LOAD_$_swiftCoreImage", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreImage_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreImage_$_Business)
  "__swift_slowDealloc", referenced from:
      _swift_rt_swift_slowDealloc in libBusiness.a(TestSwift.o)
  "__swift_FORCE_LOAD_$_swiftObjectiveC", referenced from:
      __swift_FORCE_LOAD_$_swiftObjectiveC_$_Business in libBusiness.a(TestSwift.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftObjectiveC_$_Business)
  "value witness table for Builtin.UnknownObject", referenced from:
      full type metadata for Business.TestSwift in libBusiness.a(TestSwift.o)
  "__swift_getInitializedObjCClass", referenced from:
      _swift_rt_swift_getInitializedObjCClass in libBusiness.a(TestSwift.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...